@brief The platform get time function to be used by the SDK for MQTT connections.
*
@return The time (in seconds) since Unix epoch.
/
typedef uint64_t ( AzureIoTGetCurrentTimeFunc_t )( void );
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
[X] I agree to follow this project's Code of Conduct
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