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
jsonencoder.h@17:fa1bba4c6053, 2016-11-16 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Wed Nov 16 21:38:26 2016 -0800
- Revision:
- 17:fa1bba4c6053
- Parent:
- 10:c2aee3965a83
- Child:
- 36:7d12a5386197
1.0.10
Who changed what in which revision?
User | Revision | Line number | New 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 | |
Azure.IoT Build | 10:c2aee3965a83 | 7 | #include "azure_c_shared_utility/macro_utils.h" |
Azure.IoT Build | 10:c2aee3965a83 | 8 | #include "azure_c_shared_utility/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 | 17:fa1bba4c6053 | 38 | #include "azure_c_shared_utility/umock_c_prod.h" |
AzureIoTClient | 17:fa1bba4c6053 | 39 | |
AzureIoTClient | 17:fa1bba4c6053 | 40 | MOCKABLE_FUNCTION(, JSON_ENCODER_TOSTRING_RESULT, JSONEncoder_CharPtr_ToString, STRING_HANDLE, destination, const void*, value); |
AzureIoTClient | 17:fa1bba4c6053 | 41 | MOCKABLE_FUNCTION(, JSON_ENCODER_RESULT, JSONEncoder_EncodeTree, MULTITREE_HANDLE, treeHandle, STRING_HANDLE, destination, JSON_ENCODER_TOSTRING_FUNC, toStringFunc); |
AzureIoTClient | 0:1f9b2707ec7d | 42 | |
AzureIoTClient | 0:1f9b2707ec7d | 43 | #ifdef __cplusplus |
AzureIoTClient | 0:1f9b2707ec7d | 44 | } |
AzureIoTClient | 0:1f9b2707ec7d | 45 | #endif |
AzureIoTClient | 0:1f9b2707ec7d | 46 | |
AzureIoTClient | 0:1f9b2707ec7d | 47 | |
AzureIoTClient | 0:1f9b2707ec7d | 48 | #endif /* JSONENCODER_H */ |