Azure / azure-iot-middleware-freertos

Azure IoT Middleware for FreeRTOS
https://azure.github.io/azure-iot-middleware-freertos/
MIT License
79 stars 25 forks source link

coreMQTT expects getTime function to return ms accuracy from the getTime() function while the middleware expects a sec accuracy. #323

Open ottovis opened 6 months ago

ottovis commented 6 months ago

Is there an existing issue for this?

Version

1.1.0

Description of the issue

At source/include/azure_iot.h:43 it states:

/**

On the esp32 idf platform, by a sample, this is set by a function that calls idf's now(). This is accurate to the comment as this returns seconds since epoch. link to the sample on line 321

This is also used by the pnp sample as seconds link. See line 522.

However, the coreMQTT and coreHTTP implementations expect this function to return a ms accurate time, looking at this in the function sendPacket() at line 596. The naming of the variables show that it expected to be milliseconds.

The link between the ullGetUnixTime and the getTime gets set by AzureIoTProvisioningClient_Init and AzureIoTHubClient_Init here at line 389

Might be related to #294

Expected behavior

Expected the getTime to be ms accurate, since this is used for the timeout of the mqtt processloop. Currently it is not possible to actually have the function timeout.

Steps to reproduce the issue

No response

Relevant log output

No response

Code of Conduct