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
doublylinkedlist.h
00001 // Copyright (c) Microsoft. All rights reserved. 00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 00003 00004 #ifndef DOUBLYLINKEDLIST_H 00005 #define DOUBLYLINKEDLIST_H 00006 00007 #ifdef __cplusplus 00008 #include <cstddef> 00009 extern "C" 00010 { 00011 #else 00012 #include <stddef.h> 00013 #endif 00014 00015 #include <stdint.h> 00016 #include "azure_c_shared_utility/umock_c_prod.h" 00017 00018 typedef struct DLIST_ENTRY_TAG 00019 { 00020 struct DLIST_ENTRY_TAG *Flink; 00021 struct DLIST_ENTRY_TAG *Blink; 00022 } DLIST_ENTRY, *PDLIST_ENTRY; 00023 00024 MOCKABLE_FUNCTION(, void, DList_InitializeListHead, PDLIST_ENTRY, listHead); 00025 MOCKABLE_FUNCTION(, int, DList_IsListEmpty, const PDLIST_ENTRY, listHead); 00026 MOCKABLE_FUNCTION(, void, DList_InsertTailList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, listEntry); 00027 MOCKABLE_FUNCTION(, void, DList_InsertHeadList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, listEntry); 00028 MOCKABLE_FUNCTION(, void, DList_AppendTailList, PDLIST_ENTRY, listHead, PDLIST_ENTRY, ListToAppend); 00029 MOCKABLE_FUNCTION(, int, DList_RemoveEntryList, PDLIST_ENTRY, listEntry); 00030 MOCKABLE_FUNCTION(, PDLIST_ENTRY, DList_RemoveHeadList, PDLIST_ENTRY, listHead); 00031 00032 // 00033 // Calculate the address of the base of the structure given its type, and an 00034 // address of a field within the structure. 00035 // 00036 #define containingRecord(address, type, field) ((type *)((uintptr_t)(address) - offsetof(type,field))) 00037 00038 #ifdef __cplusplus 00039 } 00040 #else 00041 #endif 00042 00043 #endif /* DOUBLYLINKEDLIST_H */
Generated on Wed Jul 13 2022 07:19:04 by 1.7.2