Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
ottovis opened this issue Mar 13, 2024 · 0 comments

Comments

@ottovis
Copy link

ottovis commented Mar 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Version

1.1.0

Description of the issue

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

/**

  • @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

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant