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.

main.cpp

Committer:
AzureIoTClient
Date:
2016-01-26
Revision:
21:b8b8782d412f
Parent:
16:b2c6de619743
Child:
25:9cb9b0c15218

File content as of revision 21:b8b8782d412f:

// 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"
#include "NTPClient.h"
#include "azureiot_common/platform.h"


int main(void)
{
	int result;
    (void)printf("Initializing mbed specific things...\r\n");

    /* These are needed in order to initialize the time provider for Proton-C */
    mbed_log_init();
    mbedtime_init();

	if ((result = platform_init()) != 0)
	{
		(void)printf("Error initializing the platform: %d\r\n",result);
		return -1;
	}

    simplesample_amqp_run();

	platform_deinit();
	return 0;
}