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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers constbuffer.h Source File

constbuffer.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 CONSTBUFFER_H
00005 #define CONSTBUFFER_H
00006 
00007 #include "azure_c_shared_utility/buffer_.h"
00008 
00009 #ifdef __cplusplus
00010 #include <cstddef>
00011 extern "C"
00012 {
00013 #else
00014 #include <stddef.h>
00015 #endif
00016 
00017 #include "azure_c_shared_utility/umock_c_prod.h"
00018 
00019 /*this is the handle*/
00020 typedef struct CONSTBUFFER_HANDLE_DATA_TAG* CONSTBUFFER_HANDLE;
00021 
00022 /*this is what is returned when the content of the buffer needs access*/
00023 typedef struct CONSTBUFFER_TAG
00024 {
00025     const unsigned char* buffer;
00026     size_t size;
00027 } CONSTBUFFER;
00028 
00029 /*this creates a new constbuffer from a memory area*/
00030 MOCKABLE_FUNCTION(, CONSTBUFFER_HANDLE, CONSTBUFFER_Create, const unsigned char*, source, size_t, size);
00031 
00032 /*this creates a new constbuffer from an existing BUFFER_HANDLE*/
00033 MOCKABLE_FUNCTION(, CONSTBUFFER_HANDLE, CONSTBUFFER_CreateFromBuffer, BUFFER_HANDLE, buffer);
00034 
00035 MOCKABLE_FUNCTION(, CONSTBUFFER_HANDLE, CONSTBUFFER_Clone, CONSTBUFFER_HANDLE, constbufferHandle);
00036 
00037 MOCKABLE_FUNCTION(, const CONSTBUFFER*, CONSTBUFFER_GetContent, CONSTBUFFER_HANDLE, constbufferHandle);
00038 
00039 MOCKABLE_FUNCTION(, void, CONSTBUFFER_Destroy, CONSTBUFFER_HANDLE, constbufferHandle);
00040 
00041 #ifdef __cplusplus
00042 }
00043 #endif
00044 
00045 #endif  /* CONSTBUFFER_H */