Skip to content

Unexpected behaviour of ensureEnabled within update #26

Description

@PaulZC

I'm writing a new example to test RTCM generation in Rover mode - specifically to test 1230 generation with v2.02 firmware

My loop() is simply:

void loop()
{
    myGNSS.update(); // Process bytes as they arrive from LG290P. Call rtcmCallback as needed
}

I have called myGNSS.rtcmSubscribeAll(rtcmCallback) to set up the callback for RTCM

update processes incoming RTCM and calls rtcmCallback as needed

update sets lg290PLibrarySemaphoreBlock true

In code below rtcmCallback, I want to use the GNSS time, which I get using myGNSS.getHour() etc.

getHour() ensures the PQTMPVT message is enabled by calling ensurePvtEnabled()

ensurePvtEnabled() calls ensureMsgEnabled to enable "PQTMPVT" if needed

ensureMsgEnabled calls setMessageRate

setMessageRate calls sendOkCommand to enable the PVT message

sendOkCommand calls sendCommand

sendCommand exits early because lg290PLibrarySemaphoreBlock is true because we are still inside update()

bool LG290P::sendCommand(const char *command, const char *parms, uint16_t maxWaitMs, bool waitForResponse)
{
if (lg290PLibrarySemaphoreBlock)
return false;

Long story short, PVT is never enabled and getHour etc. return zero

I'm still thinking about possible solutions...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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