Skip to content

Length field as ASCII number? #81

@Knaldgas

Description

@Knaldgas

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions