Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L0tx cp850 decoding bug #132

Open
PennyHow opened this issue Apr 13, 2023 · 0 comments
Open

L0tx cp850 decoding bug #132

PennyHow opened this issue Apr 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@PennyHow
Copy link
Member

PennyHow commented Apr 13, 2023

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 = self.payload[1:]

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.

Recreating the current de-bug

Download and unzip this example transmission messages from KAN_B: SBD Msg From Unit: 300034012256830_1500013.zip

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()
@PennyHow PennyHow added the bug Something isn't working label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant