More MODE and FLAGS additions
This commit is contained in:
parent
87260cc56e
commit
d9cf7c3b8a
|
@ -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
|
# Process the MODE byte in registration/peer list packets for determining master and peer capabilities
|
||||||
#
|
#
|
||||||
def process_mode_byte(_hex_mode):
|
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
|
# Determine whether or not the peer is operational
|
||||||
_peer_op = bool(_mode & PEER_OP_MSK)
|
_peer_op = bool(_mode & PEER_OP_MSK)
|
||||||
|
@ -246,8 +246,6 @@ def process_mode_byte(_hex_mode):
|
||||||
_peer_mode = 'ANALOG'
|
_peer_mode = 'ANALOG'
|
||||||
elif _mode & PEER_MODE_DIGITAL:
|
elif _mode & PEER_MODE_DIGITAL:
|
||||||
_peer_mode = 'DIGITAL'
|
_peer_mode = 'DIGITAL'
|
||||||
else:
|
|
||||||
_peer_mode = 'UNKNOWN'
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'PEER_OP': _peer_op,
|
'PEER_OP': _peer_op,
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# .... ..xx = IPSC Slot 2: 10 on, 01 off
|
# .... ..xx = IPSC Slot 2: 10 on, 01 off
|
||||||
# MASK VALUES:
|
# MASK VALUES:
|
||||||
PEER_OP_MSK = 0b01000000
|
PEER_OP_MSK = 0b01000000
|
||||||
PEER_MODE_MSK = 0b00110000
|
PEER_MODE_MSK = 0b00110000
|
||||||
PEER_MODE_ANALOG = 0b00010000
|
PEER_MODE_ANALOG = 0b00010000
|
||||||
PEER_MODE_DIGITAL = 0b00100000
|
PEER_MODE_DIGITAL = 0b00100000
|
||||||
IPSC_TS1_MSK = 0b00001100
|
IPSC_TS1_MSK = 0b00001100
|
||||||
|
|
Loading…
Reference in New Issue