Skip to content

spotToStart needs to be at least uint16_t in extract* functions #109

Closed
@egonbeermat

Description

@egonbeermat

In these function definitions, spotToStart needs to be at least uint16_t:

	uint32_t extractLong(ubxPacket *msg, uint8_t spotToStart); 
	int32_t extractSignedLong(ubxPacket *msg, uint8_t spotToStart); 
	uint16_t extractInt(ubxPacket *msg, uint8_t spotToStart); 
	int16_t extractSignedInt(ubxPacket *msg, int8_t spotToStart);
	uint8_t extractByte(ubxPacket *msg, uint8_t spotToStart); 
	int8_t extractSignedChar(ubxPacket *msg, uint8_t spotToStart); 

ubxPacket can be > 255 bytes. The UBX-NAV-SAT message contains an array of satellites; once this array size passes 20, corrupted data is returned from processUBXpacket when processing the incoming data using these extract functions, as "spotToStart" has a value > 255.

Can be tested with the CallbackExample7_NAV_SAT.ino - If the satellite list is > 20 satellites, corrupted data is displayed. Changing these function definitions to uint16_t resolves the issue.

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