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.

Committer:
Azure.IoT Build
Date:
Thu Feb 04 11:33:25 2016 -0800
Revision:
25:9cb9b0c15218
Parent:
21:b8b8782d412f
Child:
26:9662f727e974
1.0.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzureIoTClient 16:b2c6de619743 1 // Copyright (c) Microsoft. All rights reserved.
AzureIoTClient 16:b2c6de619743 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
AzureIoTClient 16:b2c6de619743 3
AzureIoTClient 16:b2c6de619743 4 #include <stdio.h>
AzureIoTClient 16:b2c6de619743 5 #include "EthernetInterface.h"
AzureIoTClient 16:b2c6de619743 6 #include "mbed/logging.h"
AzureIoTClient 16:b2c6de619743 7 #include "mbed/mbedtime.h"
AzureIoTClient 16:b2c6de619743 8 #include "simplesample_amqp.h"
AzureIoTClient 16:b2c6de619743 9 #include "NTPClient.h"
AzureIoTClient 21:b8b8782d412f 10 #include "azureiot_common/platform.h"
AzureIoTClient 16:b2c6de619743 11
AzureIoTClient 16:b2c6de619743 12
AzureIoTClient 16:b2c6de619743 13 int main(void)
AzureIoTClient 16:b2c6de619743 14 {
AzureIoTClient 21:b8b8782d412f 15 int result;
AzureIoTClient 16:b2c6de619743 16 (void)printf("Initializing mbed specific things...\r\n");
AzureIoTClient 16:b2c6de619743 17
AzureIoTClient 16:b2c6de619743 18 mbed_log_init();
AzureIoTClient 16:b2c6de619743 19 mbedtime_init();
AzureIoTClient 16:b2c6de619743 20
AzureIoTClient 21:b8b8782d412f 21 if ((result = platform_init()) != 0)
AzureIoTClient 16:b2c6de619743 22 {
AzureIoTClient 21:b8b8782d412f 23 (void)printf("Error initializing the platform: %d\r\n",result);
AzureIoTClient 16:b2c6de619743 24 return -1;
AzureIoTClient 16:b2c6de619743 25 }
AzureIoTClient 16:b2c6de619743 26
AzureIoTClient 16:b2c6de619743 27 simplesample_amqp_run();
AzureIoTClient 16:b2c6de619743 28
AzureIoTClient 21:b8b8782d412f 29 platform_deinit();
AzureIoTClient 16:b2c6de619743 30 return 0;
AzureIoTClient 16:b2c6de619743 31 }