Simple sample that demonstrates reading the FXOS8700CQ accelerometer, convert the data to JSON and send to an Azure IoT Hub.

Dependencies:   azure_umqtt_c iothub_mqtt_transport mbed-rtos mbed wolfSSL Socket lwip-eth lwip-sys lwip

Committer:
markrad
Date:
Tue Apr 25 01:33:13 2017 +0000
Revision:
7:2564d95cbf81
Parent:
3:c0556ff7b8e3
Fix bug in NTP library. Clean up code some.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
markrad 3:c0556ff7b8e3 1 // Copyright (c) Microsoft. All rights reserved.
markrad 3:c0556ff7b8e3 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
markrad 3:c0556ff7b8e3 3
markrad 3:c0556ff7b8e3 4 /** @file iothub_client_ll.h
markrad 3:c0556ff7b8e3 5 * @brief APIs that allow a user (usually a device) to communicate
markrad 3:c0556ff7b8e3 6 * with an Azure IoTHub.
markrad 3:c0556ff7b8e3 7 *
markrad 3:c0556ff7b8e3 8 * @details IoTHubClient_LL is a module that allows a user (usually a
markrad 3:c0556ff7b8e3 9 * device) to communicate with an Azure IoTHub. It can send events
markrad 3:c0556ff7b8e3 10 * and receive messages. At any given moment in time there can only
markrad 3:c0556ff7b8e3 11 * be at most 1 message callback function.
markrad 3:c0556ff7b8e3 12 *
markrad 3:c0556ff7b8e3 13 * This API surface contains a set of APIs that allows the user to
markrad 3:c0556ff7b8e3 14 * interact with the lower layer portion of the IoTHubClient. These APIs
markrad 3:c0556ff7b8e3 15 * contain @c _LL_ in their name, but retain the same functionality like the
markrad 3:c0556ff7b8e3 16 * @c IoTHubClient_... APIs, with one difference. If the @c _LL_ APIs are
markrad 3:c0556ff7b8e3 17 * used then the user is responsible for scheduling when the actual work done
markrad 3:c0556ff7b8e3 18 * by the IoTHubClient happens (when the data is sent/received on/from the wire).
markrad 3:c0556ff7b8e3 19 * This is useful for constrained devices where spinning a separate thread is
markrad 3:c0556ff7b8e3 20 * often not desired.
markrad 3:c0556ff7b8e3 21 */
markrad 3:c0556ff7b8e3 22
markrad 3:c0556ff7b8e3 23 #ifndef DONT_USE_UPLOADTOBLOB
markrad 3:c0556ff7b8e3 24
markrad 3:c0556ff7b8e3 25 #ifndef IOTHUB_CLIENT_LL_UPLOADTOBLOB_H
markrad 3:c0556ff7b8e3 26 #define IOTHUB_CLIENT_LL_UPLOADTOBLOB_H
markrad 3:c0556ff7b8e3 27
markrad 3:c0556ff7b8e3 28 #include "iothub_client_ll.h"
markrad 3:c0556ff7b8e3 29
markrad 3:c0556ff7b8e3 30 #include "azure_c_shared_utility/umock_c_prod.h"
markrad 3:c0556ff7b8e3 31 #ifdef __cplusplus
markrad 3:c0556ff7b8e3 32 #include <cstddef>
markrad 3:c0556ff7b8e3 33 extern "C"
markrad 3:c0556ff7b8e3 34 {
markrad 3:c0556ff7b8e3 35 #else
markrad 3:c0556ff7b8e3 36 #include <stddef.h>
markrad 3:c0556ff7b8e3 37 #endif
markrad 3:c0556ff7b8e3 38
markrad 3:c0556ff7b8e3 39 typedef struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE_DATA* IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE;
markrad 3:c0556ff7b8e3 40
markrad 3:c0556ff7b8e3 41 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, IoTHubClient_LL_UploadToBlob_Create, const IOTHUB_CLIENT_CONFIG*, config);
markrad 3:c0556ff7b8e3 42 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadToBlob_Impl, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle, const char*, destinationFileName, const unsigned char*, source, size_t, size);
markrad 3:c0556ff7b8e3 43 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadToBlob_SetOption, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle, const char*, optionName, const void*, value);
markrad 3:c0556ff7b8e3 44 MOCKABLE_FUNCTION(, void, IoTHubClient_LL_UploadToBlob_Destroy, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle);
markrad 3:c0556ff7b8e3 45 #ifdef __cplusplus
markrad 3:c0556ff7b8e3 46 }
markrad 3:c0556ff7b8e3 47 #endif
markrad 3:c0556ff7b8e3 48
markrad 3:c0556ff7b8e3 49 #endif /* IOTHUB_CLIENT_LL_UPLOADTOBLOB_H */
markrad 3:c0556ff7b8e3 50
markrad 3:c0556ff7b8e3 51 #else
markrad 3:c0556ff7b8e3 52 #error "trying to #include iothub_client_ll_uploadtoblob.h in the presence of #define DONT_USE_UPLOADTOBLOB"
markrad 3:c0556ff7b8e3 53 #endif /*DONT_USE_UPLOADTOBLOB*/