You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are instances where L0tx transmission messages require cp850 decoding. Usually, the first character is dropped from the transmission as this is the payload format indicator. However, in the instance of cp850 decoding, the first character is part of the transmission message. Therefore, this causes the first character to be dropped - this is always the "2" in the year part of the timestamp (i.e. returning "023" instead of "2023").
bin_msg='2'+bin_msg.decode('cp850') #TODO de-bug so first byte is passed (currently misses of the first "2" of the year e.g. "022" instead of "2022")
The current de-bug just adds the first "2" character onto the string, but really we should restructure this so that the first character is retained. This may be simple and only require L559 to be moved to after the if statement, it just hasn't been tested.
from pypromice.tx import L0tx, loadMsg
# Load transmission message
f = "SBD Msg From Unit: 300034012256830_1500013.msg"
msg = loadMsg(f)
# Extract L0tx data from message
tx = L0tx(msg)
# Print the original payload and the outputted L0tx data
print(tx.payload)
print(tx.msg)
The pypromice.tx.L0tx.getDataLine() is where the decoding occurs.
dataline = tx.getDataLine()
The text was updated successfully, but these errors were encountered:
There are instances where L0tx transmission messages require cp850 decoding. Usually, the first character is dropped from the transmission as this is the payload format indicator. However, in the instance of cp850 decoding, the first character is part of the transmission message. Therefore, this causes the first character to be dropped - this is always the "2" in the year part of the timestamp (i.e. returning "023" instead of "2023").
pypromice/src/pypromice/tx/tx.py
Line 559 in c5613a9
pypromice/src/pypromice/tx/tx.py
Line 633 in c5613a9
The current de-bug just adds the first "2" character onto the string, but really we should restructure this so that the first character is retained. This may be simple and only require L559 to be moved to after the if statement, it just hasn't been tested.
Recreating the current de-bug
Download and unzip this example transmission messages from KAN_B: SBD Msg From Unit: 300034012256830_1500013.zip
The
pypromice.tx.L0tx.getDataLine()
is where the decoding occurs.The text was updated successfully, but these errors were encountered: