Skip to content

How to handle unsupported format chars #57

@hunt0r

Description

@hunt0r

In LogMsgGroup, a set of format characters specify the data format (e.g. 'b' = int8, 'I' = uint32, etc.). We have an "otherwise" case in our switch statement set to warn if a (future) log character is presently unsupported by Ardupilog. At present, the warning message suggests we'll capture the data as uint8, but we don't.

I'm not sure this is the best behavior, anyways. Since data types are of different lengths, if we default to some length and it's wrong, we'll corrupt the remainder of the LogMsgGroup data.

Furthermore, in the formatLength function, we threw an error if we didn't know the type... so I dunno if we would even get to this point in the code.

I think the very best design would implement a "known character types" table, and then replace the switch statements with some sort of "lookup from character types table" functionality. That would put all our character-types information in a single spot. Does this sound like a good design to you?

In the meantime, I'm happy to leave this open as a low-priority issue on GitHub.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions