More MODE and FLAGS additions

This commit is contained in:
Cort Buffington 2013-12-12 07:50:47 -06:00
parent 87260cc56e
commit d9cf7c3b8a
2 changed files with 2 additions and 4 deletions

View File

@ -228,7 +228,7 @@ def de_register_peer(_network, _peerid):
# 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)
_mode = int(h(_hex_mode), 16)
# Determine whether or not the peer is operational
_peer_op = bool(_mode & PEER_OP_MSK)
@ -246,8 +246,6 @@ def process_mode_byte(_hex_mode):
_peer_mode = 'ANALOG'
elif _mode & PEER_MODE_DIGITAL:
_peer_mode = 'DIGITAL'
else:
_peer_mode = 'UNKNOWN'
return {
'PEER_OP': _peer_op,

View File

@ -14,7 +14,7 @@
# .... ..xx = IPSC Slot 2: 10 on, 01 off
# MASK VALUES:
PEER_OP_MSK = 0b01000000
PEER_MODE_MSK = 0b00110000
PEER_MODE_MSK = 0b00110000
PEER_MODE_ANALOG = 0b00010000
PEER_MODE_DIGITAL = 0b00100000
IPSC_TS1_MSK = 0b00001100