A modelling and serializer library for Microsoft Azure IoTHub client applications

Dependents:   sht15_remote_monitoring f767zi_mqtt remote_monitoring simplesample_amqp ... more

This library implements a serializer library to be used in projects involving Microsoft Azure IoT Hub connectivity. The code is replicated from https://github.com/Azure/azure-iot-sdks

Committer:
AzureIoTClient
Date:
Tue Sep 15 21:57:26 2015 -0700
Revision:
0:1f9b2707ec7d
Child:
10:c2aee3965a83
New release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzureIoTClient 0:1f9b2707ec7d 1 // Copyright (c) Microsoft. All rights reserved.
AzureIoTClient 0:1f9b2707ec7d 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
AzureIoTClient 0:1f9b2707ec7d 3
AzureIoTClient 0:1f9b2707ec7d 4 #ifndef JSONENCODER_H
AzureIoTClient 0:1f9b2707ec7d 5 #define JSONENCODER_H
AzureIoTClient 0:1f9b2707ec7d 6
AzureIoTClient 0:1f9b2707ec7d 7 #include "macro_utils.h"
AzureIoTClient 0:1f9b2707ec7d 8 #include "strings.h"
AzureIoTClient 0:1f9b2707ec7d 9
AzureIoTClient 0:1f9b2707ec7d 10 #ifdef __cplusplus
AzureIoTClient 0:1f9b2707ec7d 11 #include "cstddef"
AzureIoTClient 0:1f9b2707ec7d 12 extern "C" {
AzureIoTClient 0:1f9b2707ec7d 13 #else
AzureIoTClient 0:1f9b2707ec7d 14 #include "stddef.h"
AzureIoTClient 0:1f9b2707ec7d 15 #endif
AzureIoTClient 0:1f9b2707ec7d 16
AzureIoTClient 0:1f9b2707ec7d 17 #include "multitree.h"
AzureIoTClient 0:1f9b2707ec7d 18
AzureIoTClient 0:1f9b2707ec7d 19 #define JSON_ENCODER_RESULT_VALUES \
AzureIoTClient 0:1f9b2707ec7d 20 JSON_ENCODER_OK, \
AzureIoTClient 0:1f9b2707ec7d 21 JSON_ENCODER_INVALID_ARG, \
AzureIoTClient 0:1f9b2707ec7d 22 JSON_ENCODER_ALREADY_EXISTS, \
AzureIoTClient 0:1f9b2707ec7d 23 JSON_ENCODER_MULTITREE_ERROR, \
AzureIoTClient 0:1f9b2707ec7d 24 JSON_ENCODER_TOSTRING_FUNCTION_ERROR, \
AzureIoTClient 0:1f9b2707ec7d 25 JSON_ENCODER_ERROR
AzureIoTClient 0:1f9b2707ec7d 26
AzureIoTClient 0:1f9b2707ec7d 27 DEFINE_ENUM(JSON_ENCODER_RESULT, JSON_ENCODER_RESULT_VALUES);
AzureIoTClient 0:1f9b2707ec7d 28
AzureIoTClient 0:1f9b2707ec7d 29 #define JSON_ENCODER_TOSTRING_RESULT_VALUES \
AzureIoTClient 0:1f9b2707ec7d 30 JSON_ENCODER_TOSTRING_OK, \
AzureIoTClient 0:1f9b2707ec7d 31 JSON_ENCODER_TOSTRING_INVALID_ARG, \
AzureIoTClient 0:1f9b2707ec7d 32 JSON_ENCODER_TOSTRING_ERROR
AzureIoTClient 0:1f9b2707ec7d 33
AzureIoTClient 0:1f9b2707ec7d 34 DEFINE_ENUM(JSON_ENCODER_TOSTRING_RESULT, JSON_ENCODER_TOSTRING_RESULT_VALUES);
AzureIoTClient 0:1f9b2707ec7d 35
AzureIoTClient 0:1f9b2707ec7d 36 typedef JSON_ENCODER_TOSTRING_RESULT(*JSON_ENCODER_TOSTRING_FUNC)(STRING_HANDLE, const void* value);
AzureIoTClient 0:1f9b2707ec7d 37
AzureIoTClient 0:1f9b2707ec7d 38 extern JSON_ENCODER_TOSTRING_RESULT JSONEncoder_CharPtr_ToString(STRING_HANDLE, const void* value);
AzureIoTClient 0:1f9b2707ec7d 39 extern JSON_ENCODER_RESULT JSONEncoder_EncodeTree(MULTITREE_HANDLE treeHandle, STRING_HANDLE destination, JSON_ENCODER_TOSTRING_FUNC toStringFunc);
AzureIoTClient 0:1f9b2707ec7d 40
AzureIoTClient 0:1f9b2707ec7d 41 #ifdef __cplusplus
AzureIoTClient 0:1f9b2707ec7d 42 }
AzureIoTClient 0:1f9b2707ec7d 43 #endif
AzureIoTClient 0:1f9b2707ec7d 44
AzureIoTClient 0:1f9b2707ec7d 45
AzureIoTClient 0:1f9b2707ec7d 46 #endif /* JSONENCODER_H */