Skip to content

Possible wrong size of data (message) array? #44

@cpm64

Description

@cpm64

Hello,

Checking the declaration of the LnMsg.data[16] . If I got it right this is the max length of a message. Searching the internet I found various answers about what is the max size of a variable length message: 16, 20. However is not clear if that size includes the OPC [0], the msg size [1] and the checksum bytes: <OPC>,<COUNT>,<ARG1>....,<CKSUM>.

I discovered that my CS is sometimes issue an '0xe6' OPC of 21 bytes which cannot be handled by LnMsg.data[16].

As a suggestion, a possible enhancement could be to make it configurable via #define LN_MAX_MSG_LEN (n) and allow the users to define their own max limit.

This is applicable to both LocoNet and LocoNet2-development branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions