A simple IoTHub sample using AMQP as transport

Dependencies:   EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed azure_c_shared_utility serializer wolfSSL azure_uamqp_c

This sample showcases the usage of Azure IoT client libraries with the AMQP transport for sending/receiving raw messages from an IoT Hub.

Revision:
5:f681a1af27c6
Parent:
2:fc3132155be8
Child:
6:8121913f61d7
--- a/main.cpp	Thu Sep 17 00:02:19 2015 -0700
+++ b/main.cpp	Thu Sep 17 00:12:52 2015 -0700
@@ -8,12 +8,13 @@
 #include "simplesample_amqp.h"
 #include "NTPClient.h"
 
-void setupRealTime(void)
+int setupRealTime(void)
 {
 	(void)printf("setupRealTime begin\r\n");
 	if (EthernetInterface::connect())
 	{
 		(void)printf("Error initializing EthernetInterface.\r\n");
+		result = __LINE__;
 	}
 	else
 	{
@@ -22,15 +23,19 @@
 		if (ntp.setTime("0.pool.ntp.org") != 0)
 		{
 			(void)printf("Failed setting time.\r\n");
+			result = __LINE__;
 		}
 		else
 		{
 			(void)printf("set time correctly!\r\n");
+			result = 0;
 		}
 		(void)printf("setupRealTime NTP end\r\n");
 		EthernetInterface::disconnect();
 	}
 	(void)printf("setupRealTime end\r\n");
+
+	return result;
 }
 
 int main(void)