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
dataserializer.h@0:1f9b2707ec7d, 2015-09-15 (annotated)
- 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?
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 DATASERIALIZER_H |
AzureIoTClient | 0:1f9b2707ec7d | 5 | #define DATASERIALIZER_H |
AzureIoTClient | 0:1f9b2707ec7d | 6 | |
AzureIoTClient | 0:1f9b2707ec7d | 7 | #include "macro_utils.h" |
AzureIoTClient | 0:1f9b2707ec7d | 8 | #include "multitree.h" |
AzureIoTClient | 0:1f9b2707ec7d | 9 | #include "buffer_.h" |
AzureIoTClient | 0:1f9b2707ec7d | 10 | |
AzureIoTClient | 0:1f9b2707ec7d | 11 | #ifdef __cplusplus |
AzureIoTClient | 0:1f9b2707ec7d | 12 | #include <cstddef> |
AzureIoTClient | 0:1f9b2707ec7d | 13 | extern "C" |
AzureIoTClient | 0:1f9b2707ec7d | 14 | { |
AzureIoTClient | 0:1f9b2707ec7d | 15 | #else |
AzureIoTClient | 0:1f9b2707ec7d | 16 | #include <stddef.h> |
AzureIoTClient | 0:1f9b2707ec7d | 17 | #endif |
AzureIoTClient | 0:1f9b2707ec7d | 18 | |
AzureIoTClient | 0:1f9b2707ec7d | 19 | /*Codes_SRS_DATA_SERIALIZER_07_001: [DataSerializer will have the following interface]*/ |
AzureIoTClient | 0:1f9b2707ec7d | 20 | #define DATA_SERIALIZER_RESULT_VALUES \ |
AzureIoTClient | 0:1f9b2707ec7d | 21 | DATA_SERIALIZER_INVALID_ARG, \ |
AzureIoTClient | 0:1f9b2707ec7d | 22 | DATA_SERIALIZER_ERROR \ |
AzureIoTClient | 0:1f9b2707ec7d | 23 | |
AzureIoTClient | 0:1f9b2707ec7d | 24 | DEFINE_ENUM(DATA_SERIALIZER_RESULT, DATA_SERIALIZER_RESULT_VALUES); |
AzureIoTClient | 0:1f9b2707ec7d | 25 | |
AzureIoTClient | 0:1f9b2707ec7d | 26 | #define DATA_SERIALIZER_MULTITREE_TYPE_VALUES \ |
AzureIoTClient | 0:1f9b2707ec7d | 27 | DATA_SERIALIZER_TYPE_CHAR_PTR, \ |
AzureIoTClient | 0:1f9b2707ec7d | 28 | DATA_SERIALIZER_TYPE_AGENT_DATA \ |
AzureIoTClient | 0:1f9b2707ec7d | 29 | |
AzureIoTClient | 0:1f9b2707ec7d | 30 | DEFINE_ENUM(DATA_SERIALIZER_MULTITREE_TYPE, DATA_SERIALIZER_MULTITREE_TYPE_VALUES); |
AzureIoTClient | 0:1f9b2707ec7d | 31 | |
AzureIoTClient | 0:1f9b2707ec7d | 32 | typedef BUFFER_HANDLE (*DATA_SERIALIZER_ENCODE_FUNC)(MULTITREE_HANDLE multiTreeHandle, DATA_SERIALIZER_MULTITREE_TYPE dataType); |
AzureIoTClient | 0:1f9b2707ec7d | 33 | typedef MULTITREE_HANDLE (*DATA_SERIALIZER_DECODE_FUNC)(BUFFER_HANDLE decodeData); |
AzureIoTClient | 0:1f9b2707ec7d | 34 | |
AzureIoTClient | 0:1f9b2707ec7d | 35 | extern BUFFER_HANDLE DataSerializer_Encode(MULTITREE_HANDLE multiTreeHandle, DATA_SERIALIZER_MULTITREE_TYPE dataType, DATA_SERIALIZER_ENCODE_FUNC encodeFunc); |
AzureIoTClient | 0:1f9b2707ec7d | 36 | extern MULTITREE_HANDLE DataSerializer_Decode(BUFFER_HANDLE data, DATA_SERIALIZER_DECODE_FUNC decodeFunc); |
AzureIoTClient | 0:1f9b2707ec7d | 37 | |
AzureIoTClient | 0:1f9b2707ec7d | 38 | #ifdef __cplusplus |
AzureIoTClient | 0:1f9b2707ec7d | 39 | } |
AzureIoTClient | 0:1f9b2707ec7d | 40 | #endif |
AzureIoTClient | 0:1f9b2707ec7d | 41 | |
AzureIoTClient | 0:1f9b2707ec7d | 42 | #endif // DATASERIALIZER_H |