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:
Fri Nov 03 13:19:59 2017 -0700
Revision:
27:1ac2fac5e8c2
Parent:
26:7c0e6f86d034
1.1.27

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 MULTITREE_H
AzureIoTClient 0:1f9b2707ec7d 5 #define MULTITREE_H
AzureIoTClient 0:1f9b2707ec7d 6
Azure.IoT Build 10:c2aee3965a83 7 #include "azure_c_shared_utility/strings.h"
Azure.IoT Build 10:c2aee3965a83 8 #include "azure_c_shared_utility/macro_utils.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 {
AzureIoTClient 0:1f9b2707ec7d 14 #else
AzureIoTClient 0:1f9b2707ec7d 15 #include <stddef.h>
AzureIoTClient 26:7c0e6f86d034 16 #include <stdbool.h>
AzureIoTClient 0:1f9b2707ec7d 17 #endif
AzureIoTClient 0:1f9b2707ec7d 18
AzureIoTClient 17:fa1bba4c6053 19 typedef struct MULTITREE_HANDLE_DATA_TAG* MULTITREE_HANDLE;
AzureIoTClient 0:1f9b2707ec7d 20
AzureIoTClient 0:1f9b2707ec7d 21 #define MULTITREE_RESULT_VALUES \
AzureIoTClient 0:1f9b2707ec7d 22 MULTITREE_OK, \
AzureIoTClient 0:1f9b2707ec7d 23 MULTITREE_INVALID_ARG, \
AzureIoTClient 0:1f9b2707ec7d 24 MULTITREE_ALREADY_HAS_A_VALUE, \
AzureIoTClient 0:1f9b2707ec7d 25 MULTITREE_EMPTY_CHILD_NAME, \
AzureIoTClient 0:1f9b2707ec7d 26 MULTITREE_EMPTY_VALUE, \
AzureIoTClient 0:1f9b2707ec7d 27 MULTITREE_OUT_OF_RANGE_INDEX, \
AzureIoTClient 0:1f9b2707ec7d 28 MULTITREE_ERROR, \
AzureIoTClient 0:1f9b2707ec7d 29 MULTITREE_CHILD_NOT_FOUND \
AzureIoTClient 0:1f9b2707ec7d 30
AzureIoTClient 0:1f9b2707ec7d 31 DEFINE_ENUM(MULTITREE_RESULT, MULTITREE_RESULT_VALUES);
AzureIoTClient 0:1f9b2707ec7d 32
AzureIoTClient 0:1f9b2707ec7d 33 typedef void (*MULTITREE_FREE_FUNCTION)(void* value);
AzureIoTClient 0:1f9b2707ec7d 34 typedef int (*MULTITREE_CLONE_FUNCTION)(void** destination, const void* source);
AzureIoTClient 0:1f9b2707ec7d 35
AzureIoTClient 17:fa1bba4c6053 36 #include "azure_c_shared_utility/umock_c_prod.h"
AzureIoTClient 17:fa1bba4c6053 37 MOCKABLE_FUNCTION(, MULTITREE_HANDLE, MultiTree_Create, MULTITREE_CLONE_FUNCTION, cloneFunction, MULTITREE_FREE_FUNCTION, freeFunction);
AzureIoTClient 17:fa1bba4c6053 38 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_AddLeaf, MULTITREE_HANDLE, treeHandle, const char*, destinationPath, const void*, value);
AzureIoTClient 17:fa1bba4c6053 39 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_AddChild, MULTITREE_HANDLE, treeHandle, const char*, childName, MULTITREE_HANDLE*, childHandle);
AzureIoTClient 17:fa1bba4c6053 40 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetChildCount, MULTITREE_HANDLE, treeHandle, size_t*, count);
AzureIoTClient 17:fa1bba4c6053 41 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetChild, MULTITREE_HANDLE, treeHandle, size_t, index, MULTITREE_HANDLE*, childHandle);
AzureIoTClient 17:fa1bba4c6053 42 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetChildByName, MULTITREE_HANDLE, treeHandle, const char*, childName, MULTITREE_HANDLE*, childHandle);
AzureIoTClient 17:fa1bba4c6053 43 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetName, MULTITREE_HANDLE, treeHandle, STRING_HANDLE, destination);
AzureIoTClient 17:fa1bba4c6053 44 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetValue, MULTITREE_HANDLE, treeHandle, const void**, destination);
AzureIoTClient 17:fa1bba4c6053 45 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetLeafValue, MULTITREE_HANDLE, treeHandle, const char*, leafPath, const void**, destination);
AzureIoTClient 17:fa1bba4c6053 46 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_SetValue, MULTITREE_HANDLE, treeHandle, void*, value);
AzureIoTClient 17:fa1bba4c6053 47 MOCKABLE_FUNCTION(, void, MultiTree_Destroy, MULTITREE_HANDLE, treeHandle);
AzureIoTClient 26:7c0e6f86d034 48 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_DeleteChild, MULTITREE_HANDLE, treeHandle, const char*, childName);
AzureIoTClient 0:1f9b2707ec7d 49
AzureIoTClient 0:1f9b2707ec7d 50 #ifdef __cplusplus
AzureIoTClient 0:1f9b2707ec7d 51 }
AzureIoTClient 0:1f9b2707ec7d 52 #endif
AzureIoTClient 0:1f9b2707ec7d 53
AzureIoTClient 0:1f9b2707ec7d 54 #endif