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 gb_stdio.c Source File

gb_stdio.c

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 /*depending if the symbol GB_STDIO_INTERCEPT is defined, this file does the following
00005 
00006     a) if GB_STDIO_INTERCEPT is NOT defined, then the file shall be empty (almost:)
00007     b) if GB_STDIO_INTERCEPT is defined, then the file shall call to the 'real' stdio.h functions from their gb_* synonyms*/
00008 
00009 static const int avoid_a_warning_C4206 = 0; /* warning C4206: nonstandard extension used: translation unit is empty*/
00010 
00011 #ifdef GB_STDIO_INTERCEPT
00012 
00013 #ifdef __cplusplus
00014 #include <cstdio>
00015 #include <cstdarg>
00016 #else
00017 #include <stdio.h>
00018 #include <stdarg.h>
00019 #endif
00020 
00021 #include "azure_c_shared_utility/gb_stdio.h"
00022 
00023 /*this is fopen*/
00024 FILE *gb_fopen(const char * filename, const char * mode)
00025 {
00026     return fopen(filename, mode);
00027 }
00028 
00029 int gb_fclose(FILE *stream)
00030 {
00031     return fclose(stream);
00032 }
00033 
00034 int gb_fseek(FILE *stream, long int offset, int whence)
00035 {
00036     return fseek(stream, offset, whence);
00037 }
00038 
00039 long int gb_ftell(FILE *stream)
00040 {
00041     return ftell(stream);
00042 }
00043 
00044 int fprintf(FILE * stream, const char * format, ...)
00045 {
00046     va_list args;
00047     va_start(args, format);
00048     vfprintf(stream, format, args);
00049     va_end(args);
00050 }
00051 
00052 #endif