lwvmobile
DSD-FME
- Joined
- Apr 26, 2020
- Messages
- 1,477
- Reaction score
- 1,021
Got it whittled down a little bit more, getting text labels now, but finding they are broken up into multiple parts, so trying to figure out how to figure out which order they go in and how to put it all together.
Here is an example of 'Med 17 Front'
Here is my current working modifications to multi_rx.py
Here is an example of 'Med 17 Front'
and 'Live Oak'2022-01-18 22:41:18.211598
LABEL HEX = 4d454420
LABEL STR = MED
2022-01-18 22:41:18.850800
LABEL HEX = 31372046
LABEL STR = 17 F
2022-01-18 22:41:19.488182
LABEL HEX = 726f6e74
LABEL STR = ront
But you don't always get these all in order, or all of them every time. I often get just 'Live' without the 'Oak'. I'm going to presume they come in on other msgtype or lich values. Will have to investigate more at another time.2022-01-18 22:44:22.785680
LABEL HEX = 4c697665
LABEL STR = Live
2022-01-18 22:44:23.425399
LABEL HEX = 204f616b
LABEL STR = Oak
Here is my current working modifications to multi_rx.py
Code:
from datetime import datetime
import codecs #can't even remember if I still need this one for decoding strings or not
rid2 = 0
label2 = 0
##skip a few##
def process_nxdn_msg(self, s):
global rid2
global label2
if isinstance(s[0], str): # for python 2/3
s = [ord(x) for x in s]
msgtype = chr(s[0])
lich = s[1]
now = datetime.now()
#if msgtype == 'f':
if lich == 0x41:
rid = int.from_bytes(s, "big")
if ((rid & 0xFFFFF0000000000) >> 40) > 0 and rid2 != rid:
sys.stderr.write ('%s\n' %(now))
sys.stderr.write ('RID = %d\n' % ((rid&0xFFFFF0000000000)>>40))
rid2 = rid
#if msgtype == 'S':
if lich == 0x57:
label = int.from_bytes(s, "big")
if (label & 0xFFFFFFFF) > 0x1FFFFFFF and label2 != label:
sys.stderr.write ('%s\n' %(now))
sys.stderr.write ('LABEL HEX = %x\n' % (label&0xFFFFFFFF))
name = s[8:].decode('utf-8', errors='ignore')
sys.stderr.write ('LABEL STR = %s\n' % (name))
label2 = label
##continues same as current





