From bbf5ce528248262adc1cccc23ba892802cc062f0 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Wed, 11 Dec 2013 20:56:39 -0600 Subject: [PATCH] See Previous Commit --- dmrlink.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dmrlink.py b/dmrlink.py index a187e11..823d322 100755 --- a/dmrlink.py +++ b/dmrlink.py @@ -224,7 +224,8 @@ def de_register_peer(_network, _peerid): logger.warning('(%s) Peer De-Registration Requested for: %s, but we don\'t have a listing for this peer', _network, h(_peerid)) pass -# Proccess the MODE byte in for determining master and peer capabilities + +# Process the MODE byte in registration/peer list packets for determining master and peer capabilities # def process_mode_byte(_hex_mode): _mode = int(h(_hex_mode), 16) @@ -251,14 +252,20 @@ def process_mode_byte(_hex_mode): # Determine whether or not timeslot 1 is linked if _mode & IPSC_TS1_MSK: - _ts1 = True - + _ts1 = True # Determine whether or not timeslot 2 is linked if _mode & IPSC_TS2_MSK: _ts2 = True return {'PEER_OP': _peer_op, 'PEER_MODE': _peer_mode, 'TS_1': _ts1, 'TS_2': _ts2} - + + +# Process the FLAGS bytes in registration replies for determining what services are available +# +def process_flags_bytes(_hex_flags): + # This should be my next endeavor... + pass + # Take a received peer list and the network it belongs to, process and populate the # data structure in my_ipsc_config with the results, and return a simple list of peers. @@ -289,7 +296,8 @@ def process_peer_list(_data, _network): _decoded_mode = process_mode_byte(_hex_mode) # Write or re-write this peer if it's already in our list. Why re-write? Mode may have changed! - + # This means we'll re-register with a peer who we may have already been registered with, but + # that doesn't appear to hurt anything. NETWORK[_network]['PEERS'][_hex_radio_id] = { 'IP': _ip_address, 'PORT': _port,