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

Length field as ASCII number? #81

Open
Knaldgas opened this issue Feb 4, 2022 · 0 comments
Open

Length field as ASCII number? #81

Knaldgas opened this issue Feb 4, 2022 · 0 comments

Comments

@Knaldgas
Copy link

Knaldgas commented Feb 4, 2022

Trying to learn Rammbock.
Example of a message in this protocol:

\x020000165{"telNo":241,"et":"190521_152059.933","src":"F01-1","dst":"MFS","func":"DATINF","dateTimeGMT":"190521_152059.933","msToLocalTime":3600000,"timeZone":"Europe/Berlin"}0779320932\x03

I've managed to define the protocol:

New protocol   SDXP
u8      STX    2
chars   7    length
chars   165   json
chars   10    CRC
u8      ETX    3
End protocol

But that only works for this particular message.

  • The length is 7-character ASCII encoded integer, how can I use that for the json length (instead of the fixed 165)?
  • Is there a way to automatically calculate/validate the CRC (also ASCII encoded integer)?
  • Is this the right way to define this protocol?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant