Demo using MBED TLS

Dependencies:   EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed

Fork of iothub_client_sample_amqp by Azure IoT

Committer:
markrad
Date:
Thu Jan 05 00:20:03 2017 +0000
Revision:
58:f50b97b08851
Sample using MBED TLS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
markrad 58:f50b97b08851 1 // Copyright (c) Microsoft. All rights reserved.
markrad 58:f50b97b08851 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
markrad 58:f50b97b08851 3
markrad 58:f50b97b08851 4 /*depending if the symbol GB_STDIO_INTERCEPT is defined, this file does the following
markrad 58:f50b97b08851 5
markrad 58:f50b97b08851 6 a) if GB_STDIO_INTERCEPT is NOT defined, then the file shall be empty (almost:)
markrad 58:f50b97b08851 7 b) if GB_STDIO_INTERCEPT is defined, then the file shall call to the 'real' stdio.h functions from their gb_* synonyms*/
markrad 58:f50b97b08851 8
markrad 58:f50b97b08851 9 static const int avoid_a_warning_C4206 = 0; /* warning C4206: nonstandard extension used: translation unit is empty*/
markrad 58:f50b97b08851 10
markrad 58:f50b97b08851 11 #ifdef GB_STDIO_INTERCEPT
markrad 58:f50b97b08851 12
markrad 58:f50b97b08851 13 #ifdef __cplusplus
markrad 58:f50b97b08851 14 #include <cstdio>
markrad 58:f50b97b08851 15 #include <cstdarg>
markrad 58:f50b97b08851 16 #else
markrad 58:f50b97b08851 17 #include <stdio.h>
markrad 58:f50b97b08851 18 #include <stdarg.h>
markrad 58:f50b97b08851 19 #endif
markrad 58:f50b97b08851 20
markrad 58:f50b97b08851 21 #include "azure_c_shared_utility/gb_stdio.h"
markrad 58:f50b97b08851 22
markrad 58:f50b97b08851 23 /*this is fopen*/
markrad 58:f50b97b08851 24 FILE *gb_fopen(const char * filename, const char * mode)
markrad 58:f50b97b08851 25 {
markrad 58:f50b97b08851 26 return fopen(filename, mode);
markrad 58:f50b97b08851 27 }
markrad 58:f50b97b08851 28
markrad 58:f50b97b08851 29 int gb_fclose(FILE *stream)
markrad 58:f50b97b08851 30 {
markrad 58:f50b97b08851 31 return fclose(stream);
markrad 58:f50b97b08851 32 }
markrad 58:f50b97b08851 33
markrad 58:f50b97b08851 34 int gb_fseek(FILE *stream, long int offset, int whence)
markrad 58:f50b97b08851 35 {
markrad 58:f50b97b08851 36 return fseek(stream, offset, whence);
markrad 58:f50b97b08851 37 }
markrad 58:f50b97b08851 38
markrad 58:f50b97b08851 39 long int gb_ftell(FILE *stream)
markrad 58:f50b97b08851 40 {
markrad 58:f50b97b08851 41 return ftell(stream);
markrad 58:f50b97b08851 42 }
markrad 58:f50b97b08851 43
markrad 58:f50b97b08851 44 int fprintf(FILE * stream, const char * format, ...)
markrad 58:f50b97b08851 45 {
markrad 58:f50b97b08851 46 va_list args;
markrad 58:f50b97b08851 47 va_start(args, format);
markrad 58:f50b97b08851 48 vfprintf(stream, format, args);
markrad 58:f50b97b08851 49 va_end(args);
markrad 58:f50b97b08851 50 }
markrad 58:f50b97b08851 51
markrad 58:f50b97b08851 52 #endif