-
Notifications
You must be signed in to change notification settings - Fork 14
Create example to send and receive messages with Azure #2
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
Conversation
NTPClient ntp(_defaultSystemNetwork); | ||
time_t timestamp = ntp.get_timestamp(); | ||
if (timestamp < 0) { | ||
LogError("Failed to get the current time, error: %ld", timestamp); | ||
return -1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens a lot. We'd better implement a retry but it would rely on ARMmbed/ntp-client#12.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments
Setting connection status callback *after* all other callbacks seems to resolve connection failure on GCC_ARM, and it seems like the standard thing to do in Azure's existing examples. We also reduce the frequency to process Azure communication stack from once per 1ms (default) to 100ms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evedon Thanks for the review, I've addressed your comments. Also updated mbed-azure-client.lib
so the license and copyright info are in place.
Changed the base branch from master to development. This aligns with the new release model of Mbed OS official example. |
Introduction
Create an official Mbed OS example to demonstrate how to use the Azure SDK to communicate with an IoT Hub.
Note
Known issues
Todo
Add copyright headers (TBC, subsequent PR)Done, Apache-2.0 license added