![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Temperature sensor anomaly IoTHub sample
Dependencies: C12832 EthernetInterface LM75B NTPClient iothub_client iothub_http_transport mbed-rtos mbed serializer wolfSSL azure_c_shared_utility
This sample showcases the usage of Azure IoT client libraries to build an application sample that uploads temperature data and reacts to an alert for a temperature anomaly sent by a cloud service.
Diff: main.cpp
- Revision:
- 2:e6752ef906fc
- Parent:
- 0:d6584131df08
- Child:
- 4:b0b512a80572
--- a/main.cpp Wed Sep 16 21:41:40 2015 +0000 +++ b/main.cpp Wed Sep 16 22:43:33 2015 -0700 @@ -273,11 +273,20 @@ THREAD_HANDLE ThreadHandle; (void)printf("Initializing mbed specific things...\r\n"); + (void)printf("doing a one time EthernetInterface::init();\r\n"); - EthernetInterface::init(); + if (EthernetInterface::init() != 0) + { + (void)printf("Failed EthernetInterface::init();\r\n"); + return -1; + } (void)printf("done doing a one time EthernetInterface::init();\r\n"); - setupRealTime(); + if (setupRealTime() != 0) + { + (void)printf("Failed setting up real time clock\r\n"); + return -1; + } /* clear the LED light upon startup */ red_led = 1;