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.
Diff: main.cpp
- Revision:
- 0:caa8884fe136
- Child:
- 2:fc3132155be8
diff -r 000000000000 -r caa8884fe136 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 15 22:47:10 2015 -0700 @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#include <stdio.h> +#include "EthernetInterface.h" +#include "mbed/logging.h" +#include "mbed/mbedtime.h" +#include "simplesample_amqp.h" + +int main(void) +{ + (void)printf("Initializing mbed specific things...\r\n"); + + mbed_log_init(); + mbedtime_init(); + + EthernetInterface eth; + if (eth.init() || eth.connect()) + { + (void)printf("Error initializing EthernetInterface.\r\n"); + return -1; + } + + simplesample_amqp_run(); +}