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:
2:d9c585174187
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 SERIALIZER_H
AzureIoTClient 0:1f9b2707ec7d 5 #define SERIALIZER_H
AzureIoTClient 0:1f9b2707ec7d 6
AzureIoTClient 0:1f9b2707ec7d 7 #ifdef __cplusplus
AzureIoTClient 0:1f9b2707ec7d 8 #include <cstdlib>
AzureIoTClient 0:1f9b2707ec7d 9 #include <cstdarg>
AzureIoTClient 0:1f9b2707ec7d 10
AzureIoTClient 0:1f9b2707ec7d 11 #else
AzureIoTClient 0:1f9b2707ec7d 12 #include <stdlib.h>
AzureIoTClient 0:1f9b2707ec7d 13 #include <stdarg.h>
AzureIoTClient 0:1f9b2707ec7d 14 #endif
AzureIoTClient 0:1f9b2707ec7d 15
AzureIoTClient 0:1f9b2707ec7d 16 #ifdef _CRTDBG_MAP_ALLOC
AzureIoTClient 0:1f9b2707ec7d 17 #include <crtdbg.h>
AzureIoTClient 0:1f9b2707ec7d 18 #endif
AzureIoTClient 0:1f9b2707ec7d 19
AzureIoTClient 0:1f9b2707ec7d 20 #include "gballoc.h"
AzureIoTClient 0:1f9b2707ec7d 21 #include "macro_utils.h"
AzureIoTClient 0:1f9b2707ec7d 22 #include "iotdevice.h"
AzureIoTClient 0:1f9b2707ec7d 23 #include "crt_abstractions.h"
AzureIoTClient 0:1f9b2707ec7d 24 #include "iot_logging.h"
AzureIoTClient 0:1f9b2707ec7d 25 #include "schemalib.h"
AzureIoTClient 0:1f9b2707ec7d 26 #include "codefirst.h"
AzureIoTClient 0:1f9b2707ec7d 27 #include "agenttypesystem.h"
AzureIoTClient 0:1f9b2707ec7d 28 #include "schema.h"
AzureIoTClient 0:1f9b2707ec7d 29
AzureIoTClient 0:1f9b2707ec7d 30
AzureIoTClient 0:1f9b2707ec7d 31 #ifdef __cplusplus
AzureIoTClient 0:1f9b2707ec7d 32 extern "C"
AzureIoTClient 0:1f9b2707ec7d 33 {
AzureIoTClient 0:1f9b2707ec7d 34 #endif
AzureIoTClient 0:1f9b2707ec7d 35
AzureIoTClient 0:1f9b2707ec7d 36 #define IOT_AGENT_RESULT_ENUM_VALUES \
AzureIoTClient 0:1f9b2707ec7d 37 IOT_AGENT_OK, \
AzureIoTClient 0:1f9b2707ec7d 38 IOT_AGENT_AGENT_DATA_TYPES_ERROR, \
AzureIoTClient 0:1f9b2707ec7d 39 IOT_AGENT_COMMAND_EXECUTION_ERROR, \
AzureIoTClient 0:1f9b2707ec7d 40 IOT_AGENT_ERROR, \
AzureIoTClient 0:1f9b2707ec7d 41 IOT_AGENT_SERIALIZE_FAILED, \
AzureIoTClient 0:1f9b2707ec7d 42 IOT_AGENT_INVALID_ARG
AzureIoTClient 0:1f9b2707ec7d 43
AzureIoTClient 0:1f9b2707ec7d 44 DEFINE_ENUM(IOT_AGENT_RESULT, IOT_AGENT_RESULT_ENUM_VALUES);
AzureIoTClient 0:1f9b2707ec7d 45
AzureIoTClient 0:1f9b2707ec7d 46
AzureIoTClient 0:1f9b2707ec7d 47 /* IOT Agent Macros */
AzureIoTClient 0:1f9b2707ec7d 48
AzureIoTClient 0:1f9b2707ec7d 49 /* Codes_SRS_SERIALIZER_99_001:[For each completed schema declaration block, a unique storage container for schema metadata shall be available in the translation unit at runtime.] */
AzureIoTClient 0:1f9b2707ec7d 50 #define BEGIN_NAMESPACE(schemaNamespace) \
AzureIoTClient 0:1f9b2707ec7d 51 REFLECTED_END_OF_LIST
AzureIoTClient 0:1f9b2707ec7d 52
AzureIoTClient 0:1f9b2707ec7d 53 #define END_NAMESPACE(schemaNamespace) \
AzureIoTClient 0:1f9b2707ec7d 54 REFLECTED_LIST_HEAD(schemaNamespace)
AzureIoTClient 0:1f9b2707ec7d 55
AzureIoTClient 0:1f9b2707ec7d 56 /* Codes_SRS_SERIALIZER_99_080:[ The DECLARE_STRUCT declaration shall insert metadata describing a complex data type.] */
AzureIoTClient 0:1f9b2707ec7d 57 #define DECLARE_STRUCT(name, ...) \
AzureIoTClient 0:1f9b2707ec7d 58 /* Codes_SRS_SERIALIZER_99_096:[ DECLARE_STRUCT shall declare a matching C struct data type named name, which can be referenced from any code that can access the declaration.] */ \
AzureIoTClient 0:1f9b2707ec7d 59 typedef struct name##_TAG { \
AzureIoTClient 0:1f9b2707ec7d 60 FOR_EACH_2(INSERT_FIELD_INTO_STRUCT, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 61 } name; \
AzureIoTClient 0:1f9b2707ec7d 62 /* Codes_SRS_SERIALIZER_99_081:[ DECLARE_STRUCT's name argument shall uniquely identify the struct within the schema.] */ \
AzureIoTClient 0:1f9b2707ec7d 63 REFLECTED_STRUCT(name) \
AzureIoTClient 0:1f9b2707ec7d 64 /* Codes_SRS_SERIALIZER_99_082:[ DECLARE_STRUCT's field<n>Name argument shall uniquely name a field within the struct.] */ \
AzureIoTClient 0:1f9b2707ec7d 65 FOR_EACH_2_KEEP_1(REFLECTED_FIELD, name, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 66 TO_AGENT_DATA_TYPE(name, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 67 /*Codes_SRS_SERIALIZER_99_042:[ The parameter types are either predefined parameter types (specs SRS_SERIALIZER_99_004-SRS_SERIALIZER_99_014) or a type introduced by DECLARE_STRUCT.]*/ \
AzureIoTClient 0:1f9b2707ec7d 68 static AGENT_DATA_TYPES_RESULT FromAGENT_DATA_TYPE_##name(const AGENT_DATA_TYPE* source, name* destination) \
AzureIoTClient 0:1f9b2707ec7d 69 { \
AzureIoTClient 0:1f9b2707ec7d 70 AGENT_DATA_TYPES_RESULT result; \
AzureIoTClient 0:1f9b2707ec7d 71 if(source->type != EDM_COMPLEX_TYPE_TYPE) \
AzureIoTClient 0:1f9b2707ec7d 72 { \
AzureIoTClient 0:1f9b2707ec7d 73 result = AGENT_DATA_TYPES_INVALID_ARG; \
AzureIoTClient 0:1f9b2707ec7d 74 } \
AzureIoTClient 0:1f9b2707ec7d 75 else if(DIV2(COUNT_ARG(__VA_ARGS__)) != source->value.edmComplexType.nMembers) \
AzureIoTClient 0:1f9b2707ec7d 76 { \
AzureIoTClient 0:1f9b2707ec7d 77 /*too many or too few fields*/ \
AzureIoTClient 0:1f9b2707ec7d 78 result = AGENT_DATA_TYPES_INVALID_ARG; \
AzureIoTClient 0:1f9b2707ec7d 79 } \
AzureIoTClient 0:1f9b2707ec7d 80 else \
AzureIoTClient 0:1f9b2707ec7d 81 { \
AzureIoTClient 0:1f9b2707ec7d 82 result = AGENT_DATA_TYPES_OK; \
AzureIoTClient 0:1f9b2707ec7d 83 FOR_EACH_2(BUILD_DESTINATION_FIELD, __VA_ARGS__); \
AzureIoTClient 0:1f9b2707ec7d 84 } \
AzureIoTClient 0:1f9b2707ec7d 85 return result; \
AzureIoTClient 0:1f9b2707ec7d 86 } \
AzureIoTClient 0:1f9b2707ec7d 87 static void C2(destroyLocalParameter, name)(name * value) \
AzureIoTClient 0:1f9b2707ec7d 88 { \
AzureIoTClient 0:1f9b2707ec7d 89 FOR_EACH_2_KEEP_1(UNBUILD_DESTINATION_FIELD, value, __VA_ARGS__); \
AzureIoTClient 0:1f9b2707ec7d 90 }
AzureIoTClient 0:1f9b2707ec7d 91
AzureIoTClient 0:1f9b2707ec7d 92 /* WITH_DATA's name argument shall be one of the following data types: */
AzureIoTClient 0:1f9b2707ec7d 93 /* Codes_SRS_SERIALIZER_99_133:[a model type introduced previously by DECLARE_MODEL] */
AzureIoTClient 0:1f9b2707ec7d 94 #define DECLARE_MODEL(name, ...) \
AzureIoTClient 0:1f9b2707ec7d 95 REFLECTED_MODEL(name) \
AzureIoTClient 0:1f9b2707ec7d 96 typedef struct name { int :1; FOR_EACH_1(BUILD_MODEL_STRUCT, __VA_ARGS__) } name; \
AzureIoTClient 0:1f9b2707ec7d 97 FOR_EACH_1_KEEP_1(CREATE_MODEL_ELEMENT, name, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 98 TO_AGENT_DATA_TYPE(name, DROP_FIRST_COMMA_FROM_ARGS(EXPAND_MODEL_ARGS(__VA_ARGS__)))
AzureIoTClient 0:1f9b2707ec7d 99
AzureIoTClient 0:1f9b2707ec7d 100 #define WITH_DATA(type, name) MODEL_PROPERTY(type, name)
AzureIoTClient 0:1f9b2707ec7d 101
AzureIoTClient 0:1f9b2707ec7d 102 /*Codes_SRS_SERIALIZER_99_039:[WITH_ACTION shall declare an action of the current data provider called as the first macro parameter(name) and having the first parameter called parameter1Name of type parameter1Type, the second parameter named parameter2Name having the type parameter2Type and so on.]*/
AzureIoTClient 0:1f9b2707ec7d 103 #define WITH_ACTION(name, ...) MODEL_ACTION(name, __VA_ARGS__)
AzureIoTClient 0:1f9b2707ec7d 104
AzureIoTClient 0:1f9b2707ec7d 105 /* Codes_SRS_SERIALIZER_99_110:[ The GET_MODEL_HANDLE function macro shall first register the schema by calling CodeFirst_RegisterSchema, passing schemaNamespace and a pointer to the metadata generated in the schema declaration block.] */
AzureIoTClient 0:1f9b2707ec7d 106 /* Codes_SRS_SERIALIZER_99_094:[ GET_MODEL_HANDLE shall then call Schema_GetModelByName, passing the schemaHandle obtained from CodeFirst_RegisterSchema and modelName arguments, to retrieve the SCHEMA_MODEL_TYPE_HANDLE corresponding to the modelName argument.] */
AzureIoTClient 0:1f9b2707ec7d 107 /* Codes_SRS_SERIALIZER_99_112:[ GET_MODEL_HANDLE will return the handle for the named model.] */
AzureIoTClient 0:1f9b2707ec7d 108 #define GET_MODEL_HANDLE(schemaNamespace, modelName) \
AzureIoTClient 0:1f9b2707ec7d 109 Schema_GetModelByName(CodeFirst_RegisterSchema(TOSTRING(schemaNamespace), &ALL_REFLECTED(schemaNamespace)), #modelName)
AzureIoTClient 0:1f9b2707ec7d 110
AzureIoTClient 0:1f9b2707ec7d 111 /* Codes_SRS_SERIALIZER_01_002: [If the argument serializerIncludePropertyPath is specified, its value shall be passed to CodeFirst_Create.] */
AzureIoTClient 0:1f9b2707ec7d 112 #define CREATE_DEVICE_WITH_INCLUDE_PROPERTY_PATH(schemaNamespace, modelName, serializerIncludePropertyPath) \
AzureIoTClient 0:1f9b2707ec7d 113 (modelName*)CodeFirst_CreateDevice(GET_MODEL_HANDLE(schemaNamespace, modelName), &ALL_REFLECTED(schemaNamespace), sizeof(modelName), serializerIncludePropertyPath)
AzureIoTClient 0:1f9b2707ec7d 114
AzureIoTClient 0:1f9b2707ec7d 115 /* Codes_SRS_SERIALIZER_01_003: [If the argument serializerIncludePropertyPath is not specified, CREATE_MODEL_INSTANCE shall pass false to CodeFirst_Create.] */
AzureIoTClient 0:1f9b2707ec7d 116 #define CREATE_DEVICE_WITHOUT_INCLUDE_PROPERTY_PATH(schemaNamespace, modelName) \
AzureIoTClient 0:1f9b2707ec7d 117 (modelName*)CodeFirst_CreateDevice(GET_MODEL_HANDLE(schemaNamespace, modelName), &ALL_REFLECTED(schemaNamespace), sizeof(modelName), false)
AzureIoTClient 0:1f9b2707ec7d 118
AzureIoTClient 0:1f9b2707ec7d 119 /* Codes_SRS_SERIALIZER_99_104:[ CREATE_MODEL_INSTANCE shall call GET_MODEL_HANDLE, passing schemaNamespace and modelName, to get a model handle representing the model defined in the corresponding schema declaration block.] */
AzureIoTClient 0:1f9b2707ec7d 120 /* Codes_SRS_SERIALIZER_99_106:[ CREATE_MODEL_INSTANCE shall call CodeFirst_CreateDevice, passing the model handle (SCHEMA_MODEL_TYPE_HANDLE]*/
AzureIoTClient 0:1f9b2707ec7d 121 /* Codes_SRS_SERIALIZER_99_107:[ If CodeFirst_CreateDevice fails, CREATE_MODEL_INSTANCE shall return NULL.] */
AzureIoTClient 0:1f9b2707ec7d 122 /* Codes_SRS_SERIALIZER_99_108:[ If CodeFirst_CreateDevice succeeds, CREATE_MODEL_INSTANCE shall return a pointer to an instance of the C struct representing the model for the device.] */
AzureIoTClient 0:1f9b2707ec7d 123 #define CREATE_MODEL_INSTANCE(schemaNamespace, ...) \
AzureIoTClient 0:1f9b2707ec7d 124 IF(DIV2(COUNT_ARG(__VA_ARGS__)), CREATE_DEVICE_WITH_INCLUDE_PROPERTY_PATH, CREATE_DEVICE_WITHOUT_INCLUDE_PROPERTY_PATH) (schemaNamespace, __VA_ARGS__)
AzureIoTClient 0:1f9b2707ec7d 125
AzureIoTClient 0:1f9b2707ec7d 126 /* Codes_SRS_SERIALIZER_99_109:[ DESTROY_MODEL_INSTANCE shall call CodeFirst_DestroyDevice, passing the pointer returned from CREATE_MODEL_INSTANCE, to release all resources associated with the device.] */
AzureIoTClient 0:1f9b2707ec7d 127 #define DESTROY_MODEL_INSTANCE(deviceData) \
AzureIoTClient 0:1f9b2707ec7d 128 CodeFirst_DestroyDevice(deviceData)
AzureIoTClient 0:1f9b2707ec7d 129
AzureIoTClient 0:1f9b2707ec7d 130 /*Codes_SRS_SERIALIZER_99_113:[ SERIALIZE shall call CodeFirst_SendAsync, passing a destination, destinationSize, the number of properties to publish, and pointers to the values for each property.] */
AzureIoTClient 0:1f9b2707ec7d 131 /*Codes_SRS_SERIALIZER_99_117:[ If CodeFirst_SendAsync succeeds, SEND will return IOT_AGENT_OK.] */
AzureIoTClient 0:1f9b2707ec7d 132 /*Codes_SRS_SERIALIZER_99_114:[ If CodeFirst_SendAsync fails, SEND shall return IOT_AGENT_SERIALIZE_FAILED.] */
AzureIoTClient 0:1f9b2707ec7d 133 #define SERIALIZE(destination, destinationSize,...) ((CodeFirst_SendAsync(destination, destinationSize, COUNT_ARG(__VA_ARGS__) FOR_EACH_1(ADDRESS_MACRO, __VA_ARGS__)) == CODEFIRST_OK) ? IOT_AGENT_OK : IOT_AGENT_SERIALIZE_FAILED)
AzureIoTClient 0:1f9b2707ec7d 134
AzureIoTClient 0:1f9b2707ec7d 135 /*Codes_SRS_SERIALIZER_02_018: [EXECUTE_COMMAND macro shall call CodeFirst_ExecuteCommand passing device, commandBuffer and commandBufferSize.]*/
AzureIoTClient 0:1f9b2707ec7d 136 #define EXECUTE_COMMAND(device, command) (CodeFirst_ExecuteCommand(device, command))
AzureIoTClient 0:1f9b2707ec7d 137
AzureIoTClient 0:1f9b2707ec7d 138 /* Helper macros */
AzureIoTClient 0:1f9b2707ec7d 139
AzureIoTClient 0:1f9b2707ec7d 140 /* These macros remove a useless comma from the beginning of an argument list that looks like:
AzureIoTClient 0:1f9b2707ec7d 141 ,x1,y1,x2,y2 */
AzureIoTClient 0:1f9b2707ec7d 142 #ifdef _MSC_VER
AzureIoTClient 0:1f9b2707ec7d 143
AzureIoTClient 0:1f9b2707ec7d 144 #define DROP_FIRST_COMMA(N, x) \
AzureIoTClient 0:1f9b2707ec7d 145 x IFCOMMA_NOFIRST(N)
AzureIoTClient 0:1f9b2707ec7d 146
AzureIoTClient 0:1f9b2707ec7d 147 #define DROP_IF_EMPTY(N, x) \
AzureIoTClient 0:1f9b2707ec7d 148 IF(COUNT_ARG(x),DROP_FIRST_COMMA(N,x),x)
AzureIoTClient 0:1f9b2707ec7d 149
AzureIoTClient 0:1f9b2707ec7d 150 #define DROP_FIRST_COMMA_FROM_ARGS(...) \
AzureIoTClient 0:1f9b2707ec7d 151 FOR_EACH_1_COUNTED(DROP_IF_EMPTY, C1(__VA_ARGS__))
AzureIoTClient 0:1f9b2707ec7d 152
AzureIoTClient 0:1f9b2707ec7d 153 #else
AzureIoTClient 0:1f9b2707ec7d 154
AzureIoTClient 0:1f9b2707ec7d 155 #define DROP_FIRST_COMMA_0(N, x) \
AzureIoTClient 0:1f9b2707ec7d 156 x IFCOMMA_NOFIRST(N)
AzureIoTClient 0:1f9b2707ec7d 157
AzureIoTClient 0:1f9b2707ec7d 158 #define DROP_FIRST_COMMA_1(N, x) \
AzureIoTClient 0:1f9b2707ec7d 159 x
AzureIoTClient 0:1f9b2707ec7d 160
AzureIoTClient 0:1f9b2707ec7d 161 #define DROP_FIRST_COMMA(empty, N, x) \
AzureIoTClient 0:1f9b2707ec7d 162 C2(DROP_FIRST_COMMA_,empty)(N,x)
AzureIoTClient 0:1f9b2707ec7d 163
AzureIoTClient 0:1f9b2707ec7d 164 #define DROP_IF_EMPTY(N, x) \
AzureIoTClient 0:1f9b2707ec7d 165 DROP_FIRST_COMMA(ISEMPTY(x),N,x)
AzureIoTClient 0:1f9b2707ec7d 166
AzureIoTClient 0:1f9b2707ec7d 167 #define DROP_FIRST_COMMA_FROM_ARGS(...) \
AzureIoTClient 0:1f9b2707ec7d 168 FOR_EACH_1_COUNTED(DROP_IF_EMPTY, __VA_ARGS__)
AzureIoTClient 0:1f9b2707ec7d 169
AzureIoTClient 0:1f9b2707ec7d 170 #endif
AzureIoTClient 0:1f9b2707ec7d 171
AzureIoTClient 0:1f9b2707ec7d 172 /* These macros expand a sequence of arguments for DECLARE_MODEL that looks like
AzureIoTClient 0:1f9b2707ec7d 173 WITH_DATA(x, y), WITH_DATA(x2, y2) to a list of arguments consumed by the macro that marshalls a struct, like:
AzureIoTClient 0:1f9b2707ec7d 174 x, y, x2, y2
AzureIoTClient 0:1f9b2707ec7d 175 Actions are discarded, since no marshalling will be done for those when sending state data */
AzureIoTClient 0:1f9b2707ec7d 176 #define TO_AGENT_DT_EXPAND_MODEL_PROPERTY(x, y) ,x,y
AzureIoTClient 0:1f9b2707ec7d 177 #define TO_AGENT_DT_EXPAND_MODEL_ACTION(...)
AzureIoTClient 0:1f9b2707ec7d 178
AzureIoTClient 0:1f9b2707ec7d 179 #define TO_AGENT_DT_EXPAND_ELEMENT_ARGS(N, ...) TO_AGENT_DT_EXPAND_##__VA_ARGS__
AzureIoTClient 0:1f9b2707ec7d 180
AzureIoTClient 0:1f9b2707ec7d 181 #define EXPAND_MODEL_ARGS(...) \
AzureIoTClient 0:1f9b2707ec7d 182 FOR_EACH_1_COUNTED(TO_AGENT_DT_EXPAND_ELEMENT_ARGS, __VA_ARGS__)
AzureIoTClient 0:1f9b2707ec7d 183
AzureIoTClient 0:1f9b2707ec7d 184 #define TO_AGENT_DATA_TYPE(name, ...) \
AzureIoTClient 0:1f9b2707ec7d 185 static AGENT_DATA_TYPES_RESULT ToAGENT_DATA_TYPE_##name(AGENT_DATA_TYPE *destination, const name value) \
AzureIoTClient 0:1f9b2707ec7d 186 { \
AzureIoTClient 0:1f9b2707ec7d 187 AGENT_DATA_TYPES_RESULT result = AGENT_DATA_TYPES_OK; \
AzureIoTClient 0:1f9b2707ec7d 188 size_t iMember = 0; \
AzureIoTClient 0:1f9b2707ec7d 189 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(phantomName, 1); \
AzureIoTClient 0:1f9b2707ec7d 190 const char* memberNames[IF(DIV2(C1(COUNT_ARG(__VA_ARGS__))), DIV2(C1(COUNT_ARG(__VA_ARGS__))), 1)] = { 0 }; \
AzureIoTClient 0:1f9b2707ec7d 191 size_t memberCount = sizeof(memberNames) / sizeof(memberNames[0]); \
AzureIoTClient 0:1f9b2707ec7d 192 (void)value; \
AzureIoTClient 0:1f9b2707ec7d 193 if (memberCount == 0) \
AzureIoTClient 0:1f9b2707ec7d 194 { \
AzureIoTClient 0:1f9b2707ec7d 195 result = AGENT_DATA_TYPES_OK; \
AzureIoTClient 0:1f9b2707ec7d 196 } \
AzureIoTClient 0:1f9b2707ec7d 197 else \
AzureIoTClient 0:1f9b2707ec7d 198 { \
AzureIoTClient 0:1f9b2707ec7d 199 AGENT_DATA_TYPE members[sizeof(memberNames) / sizeof(memberNames[0])]; \
AzureIoTClient 0:1f9b2707ec7d 200 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(phantomName, 2); \
AzureIoTClient 0:1f9b2707ec7d 201 FOR_EACH_2(FIELD_AS_STRING, EXPAND_TWICE(__VA_ARGS__)) \
AzureIoTClient 0:1f9b2707ec7d 202 iMember = 0; \
AzureIoTClient 0:1f9b2707ec7d 203 INSTRUCTION_THAT_CAN_SUSTAIN_A_COMMA_STEAL; \
AzureIoTClient 0:1f9b2707ec7d 204 FOR_EACH_2(CREATE_AGENT_DATA_TYPE, EXPAND_TWICE(__VA_ARGS__)) \
AzureIoTClient 0:1f9b2707ec7d 205 INSTRUCTION_THAT_CAN_SUSTAIN_A_COMMA_STEAL; \
AzureIoTClient 0:1f9b2707ec7d 206 result = ((result == AGENT_DATA_TYPES_OK) && (Create_AGENT_DATA_TYPE_from_Members(destination, #name, sizeof(memberNames) / sizeof(memberNames[0]), memberNames, members) == AGENT_DATA_TYPES_OK)) \
AzureIoTClient 0:1f9b2707ec7d 207 ? AGENT_DATA_TYPES_OK \
AzureIoTClient 0:1f9b2707ec7d 208 : AGENT_DATA_TYPES_ERROR; \
AzureIoTClient 0:1f9b2707ec7d 209 { \
AzureIoTClient 0:1f9b2707ec7d 210 size_t jMember; \
AzureIoTClient 0:1f9b2707ec7d 211 for (jMember = 0; jMember < iMember; jMember++) \
AzureIoTClient 0:1f9b2707ec7d 212 { \
AzureIoTClient 0:1f9b2707ec7d 213 Destroy_AGENT_DATA_TYPE(&members[jMember]); \
AzureIoTClient 0:1f9b2707ec7d 214 } \
AzureIoTClient 0:1f9b2707ec7d 215 } \
AzureIoTClient 0:1f9b2707ec7d 216 } \
AzureIoTClient 0:1f9b2707ec7d 217 return result; \
AzureIoTClient 0:1f9b2707ec7d 218 }
AzureIoTClient 0:1f9b2707ec7d 219
AzureIoTClient 0:1f9b2707ec7d 220 #define FIELD_AS_STRING(x,y) memberNames[iMember++] = #y;
AzureIoTClient 0:1f9b2707ec7d 221
AzureIoTClient 0:1f9b2707ec7d 222 #define REFLECTED_LIST_HEAD(name) \
AzureIoTClient 0:1f9b2707ec7d 223 static const REFLECTED_DATA_FROM_DATAPROVIDER ALL_REFLECTED(name) = { &C2(REFLECTED_, C1(DEC(__COUNTER__))) };
AzureIoTClient 0:1f9b2707ec7d 224 #define REFLECTED_STRUCT(name) \
AzureIoTClient 0:1f9b2707ec7d 225 static const REFLECTED_SOMETHING C2(REFLECTED_, C1(INC(__COUNTER__))) = { REFLECTION_STRUCT_TYPE, &C2(REFLECTED_, C1(DEC(DEC(__COUNTER__)))), { {TOSTRING(name)}, {0}, {0}, {0}, {0}} };
AzureIoTClient 0:1f9b2707ec7d 226 #define REFLECTED_FIELD(XstructName, XfieldType, XfieldName) \
AzureIoTClient 0:1f9b2707ec7d 227 static const REFLECTED_SOMETHING C2(REFLECTED_, C1(INC(__COUNTER__))) = { REFLECTION_FIELD_TYPE, &C2(REFLECTED_, C1(DEC(DEC(__COUNTER__)))), { {0}, {TOSTRING(XfieldName), TOSTRING(XfieldType), TOSTRING(XstructName)}, {0}, {0}, {0} } };
AzureIoTClient 0:1f9b2707ec7d 228 #define REFLECTED_MODEL(name) \
AzureIoTClient 0:1f9b2707ec7d 229 static const REFLECTED_SOMETHING C2(REFLECTED_, C1(INC(__COUNTER__))) = { REFLECTION_MODEL_TYPE, &C2(REFLECTED_, C1(DEC(DEC(__COUNTER__)))), { {0}, {0}, {0}, {0}, {TOSTRING(name)} } };
AzureIoTClient 0:1f9b2707ec7d 230 #define REFLECTED_PROPERTY(type, name, modelName) \
AzureIoTClient 0:1f9b2707ec7d 231 static const REFLECTED_SOMETHING C2(REFLECTED_, C1(INC(__COUNTER__))) = { REFLECTION_PROPERTY_TYPE, &C2(REFLECTED_, C1(DEC(DEC(__COUNTER__)))), { {0}, {0}, {TOSTRING(name), TOSTRING(type), Create_AGENT_DATA_TYPE_From_Ptr_##name, offsetof(modelName, name), sizeof(type), TOSTRING(modelName)}, {0}, {0}} };
AzureIoTClient 0:1f9b2707ec7d 232 #define REFLECTED_ACTION(name, argc, argv, fn, modelName) \
AzureIoTClient 0:1f9b2707ec7d 233 static const REFLECTED_SOMETHING C2(REFLECTED_, C1(INC(__COUNTER__))) = { REFLECTION_ACTION_TYPE, &C2(REFLECTED_, C1(DEC(DEC(__COUNTER__)))), { {0}, {0}, {0}, {TOSTRING(name), (0 ? (uintptr_t)("", "") : argc), argv, fn, TOSTRING(modelName)}, {0}} };
AzureIoTClient 0:1f9b2707ec7d 234 #define REFLECTED_END_OF_LIST \
AzureIoTClient 0:1f9b2707ec7d 235 static const REFLECTED_SOMETHING C2(REFLECTED_, __COUNTER__) = { REFLECTION_NOTHING, NULL, { {0}, {0}, {0}, {0}, {0}} };
AzureIoTClient 0:1f9b2707ec7d 236
AzureIoTClient 0:1f9b2707ec7d 237 #define EXPAND_MODEL_PROPERTY(type, name) EXPAND_ARGS(MODEL_PROPERTY, type, name)
AzureIoTClient 0:1f9b2707ec7d 238 #define EXPAND_MODEL_ACTION(...) EXPAND_ARGS(MODEL_ACTION, __VA_ARGS__)
AzureIoTClient 0:1f9b2707ec7d 239
AzureIoTClient 0:1f9b2707ec7d 240 #define BUILD_MODEL_STRUCT(elem) INSERT_FIELD_FOR_##elem
AzureIoTClient 0:1f9b2707ec7d 241
AzureIoTClient 0:1f9b2707ec7d 242 #define CREATE_MODEL_ENTITY(modelName, callType, ...) EXPAND_ARGS(CREATE_##callType(modelName, __VA_ARGS__))
AzureIoTClient 0:1f9b2707ec7d 243 #define CREATE_SOMETHING(modelName, ...) EXPAND_ARGS(CREATE_MODEL_ENTITY(modelName, __VA_ARGS__))
AzureIoTClient 0:1f9b2707ec7d 244 #define CREATE_ELEMENT(modelName, elem) EXPAND_ARGS(CREATE_SOMETHING(modelName, EXPAND_ARGS(EXPAND_##elem)))
AzureIoTClient 0:1f9b2707ec7d 245
AzureIoTClient 0:1f9b2707ec7d 246 #define CREATE_MODEL_ELEMENT(modelName, elem) EXPAND_ARGS(CREATE_ELEMENT(modelName, elem))
AzureIoTClient 0:1f9b2707ec7d 247
AzureIoTClient 0:1f9b2707ec7d 248 #define INSERT_FIELD_INTO_STRUCT(x, y) x y;
AzureIoTClient 0:1f9b2707ec7d 249 #define INSERT_FIELD_FOR_MODEL_PROPERTY(type, name) INSERT_FIELD_INTO_STRUCT(type, name)
AzureIoTClient 0:1f9b2707ec7d 250 #define INSERT_FIELD_FOR_MODEL_ACTION(name, ...) /* action isn't a part of the model struct */
AzureIoTClient 0:1f9b2707ec7d 251
AzureIoTClient 0:1f9b2707ec7d 252 #define CREATE_MODEL_PROPERTY(modelName, type, name) \
AzureIoTClient 0:1f9b2707ec7d 253 IMPL_PROPERTY(type, name, modelName)
AzureIoTClient 0:1f9b2707ec7d 254
AzureIoTClient 0:1f9b2707ec7d 255 #define IMPL_PROPERTY(propertyType, propertyName, modelName) \
AzureIoTClient 0:1f9b2707ec7d 256 static int Create_AGENT_DATA_TYPE_From_Ptr_##propertyName(void* param, AGENT_DATA_TYPE* dest) \
AzureIoTClient 0:1f9b2707ec7d 257 { \
AzureIoTClient 0:1f9b2707ec7d 258 return C1(ToAGENT_DATA_TYPE_##propertyType)(dest, *(propertyType*)param); \
AzureIoTClient 0:1f9b2707ec7d 259 } \
AzureIoTClient 0:1f9b2707ec7d 260 REFLECTED_PROPERTY(propertyType, propertyName, modelName)
AzureIoTClient 0:1f9b2707ec7d 261
AzureIoTClient 0:1f9b2707ec7d 262 #define CREATE_MODEL_ACTION(modelName, actionName, ...) \
AzureIoTClient 0:1f9b2707ec7d 263 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(modelName##actionName, 1); \
AzureIoTClient 0:1f9b2707ec7d 264 EXECUTE_COMMAND_RESULT actionName (modelName* device FOR_EACH_2(DEFINE_FUNCTION_PARAMETER, __VA_ARGS__)); \
AzureIoTClient 0:1f9b2707ec7d 265 static EXECUTE_COMMAND_RESULT C2(actionName, WRAPPER)(void* device, size_t ParameterCount, const AGENT_DATA_TYPE* values); \
AzureIoTClient 0:1f9b2707ec7d 266 /*for macro purposes, this array always has at least 1 element*/ \
AzureIoTClient 0:1f9b2707ec7d 267 /*Codes_SRS_SERIALIZER_99_043:[ It is valid for a method not to have any parameters.]*/ \
AzureIoTClient 0:1f9b2707ec7d 268 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(actionName, 1); \
AzureIoTClient 0:1f9b2707ec7d 269 static const WRAPPER_ARGUMENT C2(actionName, WRAPPERARGUMENTS)[DIV2(INC(INC(COUNT_ARG(__VA_ARGS__))))] = { FOR_EACH_2_COUNTED(MAKE_WRAPPER_ARGUMENT, __VA_ARGS__) IFCOMMA(INC(INC(COUNT_ARG(__VA_ARGS__)))) {0} }; \
AzureIoTClient 0:1f9b2707ec7d 270 REFLECTED_ACTION(actionName, DIV2(COUNT_ARG(__VA_ARGS__)), C2(actionName, WRAPPERARGUMENTS), C2(actionName, WRAPPER), modelName) \
AzureIoTClient 0:1f9b2707ec7d 271 /*Codes_SRS_SERIALIZER_99_040:[ In addition to declaring the function, DECLARE_IOT_METHOD shall provide a definition for a wrapper that takes as parameters a size_t parameterCount and const AGENT_DATA_TYPE*.] */ \
AzureIoTClient 0:1f9b2707ec7d 272 /*Codes_SRS_SERIALIZER_99_041:[ This wrapper shall convert all the arguments to predefined types and then call the function written by the data provider developer.]*/ \
AzureIoTClient 0:1f9b2707ec7d 273 static EXECUTE_COMMAND_RESULT C2(actionName, WRAPPER)(void* device, size_t ParameterCount, const AGENT_DATA_TYPE* values) \
AzureIoTClient 0:1f9b2707ec7d 274 { \
AzureIoTClient 0:1f9b2707ec7d 275 EXECUTE_COMMAND_RESULT result; \
AzureIoTClient 0:1f9b2707ec7d 276 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(actionName, 2); \
AzureIoTClient 0:1f9b2707ec7d 277 /*Codes_SRS_SERIALIZER_99_045:[ If the number of passed parameters doesn't match the number of declared parameters, wrapper execution shall fail and return DATA_PROVIDER_INVALID_ARG;]*/ \
AzureIoTClient 0:1f9b2707ec7d 278 if(ParameterCount != DIV2(COUNT_ARG(__VA_ARGS__))) \
AzureIoTClient 0:1f9b2707ec7d 279 { \
AzureIoTClient 0:1f9b2707ec7d 280 result = EXECUTE_COMMAND_ERROR; \
AzureIoTClient 0:1f9b2707ec7d 281 } \
AzureIoTClient 0:1f9b2707ec7d 282 else \
AzureIoTClient 0:1f9b2707ec7d 283 { \
AzureIoTClient 0:1f9b2707ec7d 284 /*the below line takes care of initialized but not referenced parameter warning*/ \
AzureIoTClient 0:1f9b2707ec7d 285 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(actionName, 3); \
AzureIoTClient 0:1f9b2707ec7d 286 IF(DIV2(COUNT_ARG(__VA_ARGS__)), size_t iParameter = 0;, ) \
AzureIoTClient 0:1f9b2707ec7d 287 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(actionName, 4); \
AzureIoTClient 0:1f9b2707ec7d 288 /*the below line takes care of an unused parameter when values is really never questioned*/ \
AzureIoTClient 0:1f9b2707ec7d 289 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(actionName, 5); \
AzureIoTClient 0:1f9b2707ec7d 290 FOR_EACH_2(DEFINE_LOCAL_PARAMETER, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 291 DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(actionName, 6); \
AzureIoTClient 0:1f9b2707ec7d 292 IF(DIV2(COUNT_ARG(__VA_ARGS__)), , (void)values;) \
AzureIoTClient 0:1f9b2707ec7d 293 INSTRUCTION_THAT_CAN_SUSTAIN_A_COMMA_STEAL; \
AzureIoTClient 0:1f9b2707ec7d 294 FOR_EACH_2(START_BUILD_LOCAL_PARAMETER, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 295 INSTRUCTION_THAT_CAN_SUSTAIN_A_COMMA_STEAL; \
AzureIoTClient 0:1f9b2707ec7d 296 result = actionName((modelName*)device FOR_EACH_2(PUSH_LOCAL_PARAMETER, __VA_ARGS__)); \
AzureIoTClient 0:1f9b2707ec7d 297 FOR_EACH_2(END_BUILD_LOCAL_PARAMETER, __VA_ARGS__) \
AzureIoTClient 0:1f9b2707ec7d 298 } \
AzureIoTClient 0:1f9b2707ec7d 299 return result; \
AzureIoTClient 0:1f9b2707ec7d 300 }
AzureIoTClient 0:1f9b2707ec7d 301
AzureIoTClient 0:1f9b2707ec7d 302 #define CREATE_AGENT_DATA_TYPE(type, name) \
AzureIoTClient 0:1f9b2707ec7d 303 result = (( result==AGENT_DATA_TYPES_OK) && (ToAGENT_DATA_TYPE_##type( &(members[iMember]), value.name) == AGENT_DATA_TYPES_OK))?AGENT_DATA_TYPES_OK:AGENT_DATA_TYPES_ERROR; \
AzureIoTClient 0:1f9b2707ec7d 304 iMember+= ((result==AGENT_DATA_TYPES_OK)?1:0);
AzureIoTClient 0:1f9b2707ec7d 305
AzureIoTClient 0:1f9b2707ec7d 306 #define BUILD_DESTINATION_FIELD(type, name) \
AzureIoTClient 0:1f9b2707ec7d 307 if(result == AGENT_DATA_TYPES_OK) \
AzureIoTClient 0:1f9b2707ec7d 308 { \
AzureIoTClient 0:1f9b2707ec7d 309 size_t i; \
AzureIoTClient 0:1f9b2707ec7d 310 bool wasFieldConverted = false; \
AzureIoTClient 0:1f9b2707ec7d 311 for (i = 0; i < source->value.edmComplexType.nMembers; i++) \
AzureIoTClient 0:1f9b2707ec7d 312 { \
AzureIoTClient 0:1f9b2707ec7d 313 /*the name of the field of the complex type must match the name of the field of the structure (parameter name here)*/ \
AzureIoTClient 0:1f9b2707ec7d 314 if (strcmp(source->value.edmComplexType.fields[i].fieldName, TOSTRING(name)) == 0) \
AzureIoTClient 0:1f9b2707ec7d 315 { /*Codes_SRS_SERIALIZER_99_017:[ These types can either be one of the types mentioned in WITH_DATA or it can be a type introduced by a previous DECLARE_STRUCT.]*/ \
AzureIoTClient 0:1f9b2707ec7d 316 wasFieldConverted = (C2(FromAGENT_DATA_TYPE_, type)(source->value.edmComplexType.fields[i].value, &(destination->name)) == AGENT_DATA_TYPES_OK); \
AzureIoTClient 0:1f9b2707ec7d 317 break; \
AzureIoTClient 0:1f9b2707ec7d 318 } \
AzureIoTClient 0:1f9b2707ec7d 319 } \
AzureIoTClient 0:1f9b2707ec7d 320 result = (wasFieldConverted == true)? AGENT_DATA_TYPES_OK: AGENT_DATA_TYPES_INVALID_ARG; \
AzureIoTClient 0:1f9b2707ec7d 321 } \
AzureIoTClient 0:1f9b2707ec7d 322 else \
AzureIoTClient 0:1f9b2707ec7d 323 { \
AzureIoTClient 0:1f9b2707ec7d 324 /*fallthrough*/ \
AzureIoTClient 0:1f9b2707ec7d 325 }
AzureIoTClient 0:1f9b2707ec7d 326
AzureIoTClient 0:1f9b2707ec7d 327 #define UNBUILD_DESTINATION_FIELD(value, type, name) \
AzureIoTClient 0:1f9b2707ec7d 328 C2(destroyLocalParameter, type)(&(value->name));
AzureIoTClient 0:1f9b2707ec7d 329
AzureIoTClient 0:1f9b2707ec7d 330
AzureIoTClient 0:1f9b2707ec7d 331 #define ADDRESS_MACRO(x) ,&x
AzureIoTClient 0:1f9b2707ec7d 332
AzureIoTClient 0:1f9b2707ec7d 333 #define KEEP_FIRST_(X, ...) X
AzureIoTClient 0:1f9b2707ec7d 334 #ifdef _MSC_VER
AzureIoTClient 0:1f9b2707ec7d 335 #define KEEP_FIRST(X) KEEP_FIRST_ LPAREN X)
AzureIoTClient 0:1f9b2707ec7d 336 #else
AzureIoTClient 0:1f9b2707ec7d 337 #define KEEP_FIRST(X) KEEP_FIRST_(X)
AzureIoTClient 0:1f9b2707ec7d 338 #endif
AzureIoTClient 0:1f9b2707ec7d 339
AzureIoTClient 0:1f9b2707ec7d 340 #define PROMOTIONMAP_float double, double
AzureIoTClient 0:1f9b2707ec7d 341 #define PROMOTIONMAP_int8_t int, int
AzureIoTClient 0:1f9b2707ec7d 342 #define PROMOTIONMAP_uint8_t int, int
AzureIoTClient 0:1f9b2707ec7d 343 #define PROMOTIONMAP_int16_t int, int
AzureIoTClient 0:1f9b2707ec7d 344 #define PROMOTIONMAP__Bool int, int
AzureIoTClient 0:1f9b2707ec7d 345 #define PROMOTIONMAP_bool int, int
AzureIoTClient 0:1f9b2707ec7d 346
AzureIoTClient 0:1f9b2707ec7d 347 #define CASTMAP_float (float), (float)
AzureIoTClient 0:1f9b2707ec7d 348 #define CASTMAP_int8_t (int8_t), (int8_t)
AzureIoTClient 0:1f9b2707ec7d 349 #define CASTMAP_uint8_t (uint8_t), (uint8_t)
AzureIoTClient 0:1f9b2707ec7d 350 #define CASTMAP_int16_t (int16_t), (int16_t)
AzureIoTClient 0:1f9b2707ec7d 351 #define CASTMAP__Bool 0!=, 0!=
AzureIoTClient 0:1f9b2707ec7d 352 #define CASTMAP_bool 0!=, 0!=
AzureIoTClient 0:1f9b2707ec7d 353
AzureIoTClient 0:1f9b2707ec7d 354 #define EMPTY_TOKEN
AzureIoTClient 0:1f9b2707ec7d 355
AzureIoTClient 0:1f9b2707ec7d 356 #define ANOTHERIF(x) C2(ANOTHERIF,x)
AzureIoTClient 0:1f9b2707ec7d 357 #define ANOTHERIF0(a,b) a
AzureIoTClient 0:1f9b2707ec7d 358 #define ANOTHERIF1(a,b) b
AzureIoTClient 0:1f9b2707ec7d 359 #define ANOTHERIF2(a,b) b
AzureIoTClient 0:1f9b2707ec7d 360 #define ANOTHERIF3(a,b) b
AzureIoTClient 0:1f9b2707ec7d 361 #define ANOTHERIF4(a,b) b
AzureIoTClient 0:1f9b2707ec7d 362 #define ANOTHERIF5(a,b) b
AzureIoTClient 0:1f9b2707ec7d 363 #define ANOTHERIF6(a,b) b
AzureIoTClient 0:1f9b2707ec7d 364 #define ANOTHERIF7(a,b) b
AzureIoTClient 0:1f9b2707ec7d 365 #define ANOTHERIF8(a,b) b
AzureIoTClient 0:1f9b2707ec7d 366 #define ANOTHERIF9(a,b) b
AzureIoTClient 0:1f9b2707ec7d 367 #define ANOTHERIF10(a,b) b
AzureIoTClient 0:1f9b2707ec7d 368 #define ANOTHERIF11(a,b) b
AzureIoTClient 0:1f9b2707ec7d 369 #define ANOTHERIF12(a,b) b
AzureIoTClient 0:1f9b2707ec7d 370
AzureIoTClient 0:1f9b2707ec7d 371 #define MAP_PROMOTED_TYPE(X) ANOTHERIF(DEC(COUNT_ARG(PROMOTIONMAP_##X))) (X, KEEP_FIRST(PROMOTIONMAP_##X))
AzureIoTClient 0:1f9b2707ec7d 372 #define MAP_CAST_TYPE(X) ANOTHERIF(DEC(COUNT_ARG(CASTMAP_##X))) (EMPTY_TOKEN, KEEP_FIRST(CASTMAP_##X) )
AzureIoTClient 0:1f9b2707ec7d 373
AzureIoTClient 0:1f9b2707ec7d 374 #define IFCOMMA(N) C2(IFCOMMA_, N)
AzureIoTClient 0:1f9b2707ec7d 375 #define IFCOMMA_0
AzureIoTClient 0:1f9b2707ec7d 376 #define IFCOMMA_2
AzureIoTClient 0:1f9b2707ec7d 377 #define IFCOMMA_4 ,
AzureIoTClient 0:1f9b2707ec7d 378 #define IFCOMMA_6 ,
AzureIoTClient 0:1f9b2707ec7d 379 #define IFCOMMA_8 ,
AzureIoTClient 0:1f9b2707ec7d 380 #define IFCOMMA_10 ,
AzureIoTClient 0:1f9b2707ec7d 381 #define IFCOMMA_12 ,
AzureIoTClient 0:1f9b2707ec7d 382 #define IFCOMMA_14 ,
AzureIoTClient 0:1f9b2707ec7d 383 #define IFCOMMA_16 ,
AzureIoTClient 0:1f9b2707ec7d 384 #define IFCOMMA_18 ,
AzureIoTClient 0:1f9b2707ec7d 385 #define IFCOMMA_20 ,
AzureIoTClient 0:1f9b2707ec7d 386 #define IFCOMMA_22 ,
AzureIoTClient 0:1f9b2707ec7d 387 #define IFCOMMA_24 ,
AzureIoTClient 0:1f9b2707ec7d 388 #define IFCOMMA_26 ,
AzureIoTClient 0:1f9b2707ec7d 389 #define IFCOMMA_28 ,
AzureIoTClient 0:1f9b2707ec7d 390 #define IFCOMMA_30 ,
AzureIoTClient 0:1f9b2707ec7d 391 #define IFCOMMA_32 ,
AzureIoTClient 0:1f9b2707ec7d 392 #define IFCOMMA_34 ,
AzureIoTClient 0:1f9b2707ec7d 393 #define IFCOMMA_36 ,
AzureIoTClient 0:1f9b2707ec7d 394 #define IFCOMMA_38 ,
AzureIoTClient 0:1f9b2707ec7d 395 #define IFCOMMA_40 ,
AzureIoTClient 0:1f9b2707ec7d 396 #define IFCOMMA_42 ,
AzureIoTClient 0:1f9b2707ec7d 397 #define IFCOMMA_44 ,
AzureIoTClient 0:1f9b2707ec7d 398 #define IFCOMMA_46 ,
AzureIoTClient 0:1f9b2707ec7d 399 #define IFCOMMA_48 ,
AzureIoTClient 0:1f9b2707ec7d 400 #define IFCOMMA_50 ,
AzureIoTClient 0:1f9b2707ec7d 401 #define IFCOMMA_52 ,
AzureIoTClient 0:1f9b2707ec7d 402 #define IFCOMMA_54 ,
AzureIoTClient 0:1f9b2707ec7d 403 #define IFCOMMA_56 ,
AzureIoTClient 0:1f9b2707ec7d 404 #define IFCOMMA_58 ,
AzureIoTClient 0:1f9b2707ec7d 405 #define IFCOMMA_60 ,
AzureIoTClient 0:1f9b2707ec7d 406 #define IFCOMMA_62 ,
AzureIoTClient 0:1f9b2707ec7d 407 #define IFCOMMA_64 ,
AzureIoTClient 0:1f9b2707ec7d 408 #define IFCOMMA_66 ,
AzureIoTClient 0:1f9b2707ec7d 409 #define IFCOMMA_68 ,
AzureIoTClient 0:1f9b2707ec7d 410 #define IFCOMMA_70 ,
AzureIoTClient 0:1f9b2707ec7d 411 #define IFCOMMA_72 ,
AzureIoTClient 0:1f9b2707ec7d 412 #define IFCOMMA_74 ,
AzureIoTClient 0:1f9b2707ec7d 413 #define IFCOMMA_76 ,
AzureIoTClient 0:1f9b2707ec7d 414 #define IFCOMMA_78 ,
AzureIoTClient 0:1f9b2707ec7d 415 #define IFCOMMA_80 ,
AzureIoTClient 0:1f9b2707ec7d 416 #define IFCOMMA_82 ,
AzureIoTClient 0:1f9b2707ec7d 417 #define IFCOMMA_84 ,
AzureIoTClient 0:1f9b2707ec7d 418 #define IFCOMMA_86 ,
AzureIoTClient 0:1f9b2707ec7d 419 #define IFCOMMA_88 ,
AzureIoTClient 0:1f9b2707ec7d 420 #define IFCOMMA_90 ,
AzureIoTClient 0:1f9b2707ec7d 421 #define IFCOMMA_92 ,
AzureIoTClient 0:1f9b2707ec7d 422 #define IFCOMMA_94 ,
AzureIoTClient 0:1f9b2707ec7d 423 #define IFCOMMA_96 ,
AzureIoTClient 0:1f9b2707ec7d 424 #define IFCOMMA_98 ,
AzureIoTClient 0:1f9b2707ec7d 425 #define IFCOMMA_100 ,
AzureIoTClient 0:1f9b2707ec7d 426 #define IFCOMMA_102 ,
AzureIoTClient 0:1f9b2707ec7d 427 #define IFCOMMA_104 ,
AzureIoTClient 0:1f9b2707ec7d 428 #define IFCOMMA_106 ,
AzureIoTClient 0:1f9b2707ec7d 429 #define IFCOMMA_108 ,
AzureIoTClient 0:1f9b2707ec7d 430 #define IFCOMMA_110 ,
AzureIoTClient 0:1f9b2707ec7d 431 #define IFCOMMA_112 ,
AzureIoTClient 0:1f9b2707ec7d 432 #define IFCOMMA_114 ,
AzureIoTClient 0:1f9b2707ec7d 433 #define IFCOMMA_116 ,
AzureIoTClient 0:1f9b2707ec7d 434 #define IFCOMMA_118 ,
AzureIoTClient 0:1f9b2707ec7d 435 #define IFCOMMA_120 ,
AzureIoTClient 0:1f9b2707ec7d 436 #define IFCOMMA_122 ,
AzureIoTClient 0:1f9b2707ec7d 437 #define IFCOMMA_124 ,
AzureIoTClient 0:1f9b2707ec7d 438 #define IFCOMMA_126 ,
AzureIoTClient 0:1f9b2707ec7d 439 #define IFCOMMA_128 ,
AzureIoTClient 0:1f9b2707ec7d 440
AzureIoTClient 0:1f9b2707ec7d 441 #define DEFINE_LOCAL_PARAMETER(type, name) type C2(name,_local);
AzureIoTClient 0:1f9b2707ec7d 442
AzureIoTClient 0:1f9b2707ec7d 443 #define START_BUILD_LOCAL_PARAMETER(type, name) \
AzureIoTClient 0:1f9b2707ec7d 444 if (C2(FromAGENT_DATA_TYPE_, type)(&values[iParameter], &C2(name, _local)) != AGENT_DATA_TYPES_OK) \
AzureIoTClient 0:1f9b2707ec7d 445 { \
AzureIoTClient 0:1f9b2707ec7d 446 /*Codes_SRS_SERIALIZER_99_046:[ If the types of the parameters do not match the declared types, DATAPROVIDER_INVALID_ARG shall be returned.]*/ \
AzureIoTClient 0:1f9b2707ec7d 447 result = EXECUTE_COMMAND_ERROR; \
AzureIoTClient 0:1f9b2707ec7d 448 }\
AzureIoTClient 0:1f9b2707ec7d 449 else \
AzureIoTClient 0:1f9b2707ec7d 450 { \
AzureIoTClient 0:1f9b2707ec7d 451 iParameter++;
AzureIoTClient 0:1f9b2707ec7d 452
AzureIoTClient 0:1f9b2707ec7d 453 #define END_BUILD_LOCAL_PARAMETER(type, name) \
AzureIoTClient 0:1f9b2707ec7d 454 (void)C2(destroyLocalParameter, type)(&C2(name, _local)); \
AzureIoTClient 0:1f9b2707ec7d 455 }
AzureIoTClient 0:1f9b2707ec7d 456
AzureIoTClient 0:1f9b2707ec7d 457 /*The following constructs have been devised to work around the precompiler bug of Visual Studio 2005, version 14.00.50727.42*/
AzureIoTClient 0:1f9b2707ec7d 458 /* The bug is explained in https://connect.microsoft.com/VisualStudio/feedback/details/278752/comma-missing-when-using-va-args */
AzureIoTClient 0:1f9b2707ec7d 459 /*A short description is: preprocessor is myteriously eating commas ','.
AzureIoTClient 0:1f9b2707ec7d 460 In order to feed the appetite of the preprocessor, several constructs have
AzureIoTClient 0:1f9b2707ec7d 461 been devised that can sustain a missing ',' while still compiling and while still doing nothing
AzureIoTClient 0:1f9b2707ec7d 462 and while hopefully being eliminated from the code based on "doesn't do anything" so no code size penalty
AzureIoTClient 0:1f9b2707ec7d 463 */
AzureIoTClient 0:1f9b2707ec7d 464
AzureIoTClient 0:1f9b2707ec7d 465 /*the reason why all these constructs work is:
AzureIoTClient 0:1f9b2707ec7d 466 if two strings separated by a comma will lose the comma (myteriously) then they will become just one string:
AzureIoTClient 0:1f9b2707ec7d 467 "a", "b" ------Preprocessor------> "a" "b" -----Compiler----> "ab"
AzureIoTClient 0:1f9b2707ec7d 468 */
AzureIoTClient 0:1f9b2707ec7d 469
AzureIoTClient 0:1f9b2707ec7d 470 #define LOTS_OF_COMMA_TO_BE_EATEN /*there were witnesses where as many as THREE commas have been eaten!*/ \
AzureIoTClient 0:1f9b2707ec7d 471 "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
AzureIoTClient 0:1f9b2707ec7d 472 #define DEFINITION_THAT_CAN_SUSTAIN_A_COMMA_STEAL(name, instance) static const char* eatThese_COMMA_##name##instance[] = {LOTS_OF_COMMA_TO_BE_EATEN}
AzureIoTClient 0:1f9b2707ec7d 473 #define INSTRUCTION_THAT_CAN_SUSTAIN_A_COMMA_STEAL 0?LOTS_OF_COMMA_TO_BE_EATEN:LOTS_OF_COMMA_TO_BE_EATEN
AzureIoTClient 0:1f9b2707ec7d 474
AzureIoTClient 0:1f9b2707ec7d 475 #define PUSH_LOCAL_PARAMETER(type, name) , C2(name, _local)
AzureIoTClient 0:1f9b2707ec7d 476 #define DEFINE_FUNCTION_PARAMETER(type, name) , type name
AzureIoTClient 0:1f9b2707ec7d 477 #define MAKE_WRAPPER_ARGUMENT(N, type, name) {TOSTRING(type), TOSTRING(name)} IFCOMMA(N)
AzureIoTClient 0:1f9b2707ec7d 478
AzureIoTClient 0:1f9b2707ec7d 479 /*Codes_SRS_SERIALIZER_99_019:[ Create_AGENT_DATA_TYPE_from_DOUBLE]*/
AzureIoTClient 0:1f9b2707ec7d 480 /*Codes_SRS_SERIALIZER_99_004:[ The propertyType can be any of the following data types: double]*/
AzureIoTClient 0:1f9b2707ec7d 481 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, double)(AGENT_DATA_TYPE* dest, double source)
AzureIoTClient 0:1f9b2707ec7d 482 {
AzureIoTClient 0:1f9b2707ec7d 483 return Create_AGENT_DATA_TYPE_from_DOUBLE(dest, source);
AzureIoTClient 0:1f9b2707ec7d 484 }
AzureIoTClient 0:1f9b2707ec7d 485
AzureIoTClient 0:1f9b2707ec7d 486 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, double)(const AGENT_DATA_TYPE* agentData, double* dest)
AzureIoTClient 0:1f9b2707ec7d 487 {
AzureIoTClient 0:1f9b2707ec7d 488 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 489 if (agentData->type != EDM_DOUBLE_TYPE)
AzureIoTClient 0:1f9b2707ec7d 490 {
AzureIoTClient 0:1f9b2707ec7d 491 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 492 }
AzureIoTClient 0:1f9b2707ec7d 493 else
AzureIoTClient 0:1f9b2707ec7d 494 {
AzureIoTClient 0:1f9b2707ec7d 495 *dest = agentData->value.edmDouble.value;
AzureIoTClient 0:1f9b2707ec7d 496 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 497 }
AzureIoTClient 0:1f9b2707ec7d 498 return result;
AzureIoTClient 0:1f9b2707ec7d 499 }
AzureIoTClient 0:1f9b2707ec7d 500
AzureIoTClient 0:1f9b2707ec7d 501 /*Codes_SRS_SERIALIZER_99_021:[ Create_AGENT_DATA_TYPE_from_FLOAT]*/
AzureIoTClient 0:1f9b2707ec7d 502 /*Codes_SRS_SERIALIZER_99_006:[ float]*/
AzureIoTClient 0:1f9b2707ec7d 503 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, float)(AGENT_DATA_TYPE* dest, float source)
AzureIoTClient 0:1f9b2707ec7d 504 {
AzureIoTClient 0:1f9b2707ec7d 505 return Create_AGENT_DATA_TYPE_from_FLOAT(dest, source);
AzureIoTClient 0:1f9b2707ec7d 506 }
AzureIoTClient 0:1f9b2707ec7d 507
AzureIoTClient 0:1f9b2707ec7d 508 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, float)(const AGENT_DATA_TYPE* agentData, float* dest)
AzureIoTClient 0:1f9b2707ec7d 509 {
AzureIoTClient 0:1f9b2707ec7d 510 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 511 if (agentData->type != EDM_SINGLE_TYPE)
AzureIoTClient 0:1f9b2707ec7d 512 {
AzureIoTClient 0:1f9b2707ec7d 513 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 514 }
AzureIoTClient 0:1f9b2707ec7d 515 else
AzureIoTClient 0:1f9b2707ec7d 516 {
AzureIoTClient 0:1f9b2707ec7d 517 *dest = agentData->value.edmSingle.value;
AzureIoTClient 0:1f9b2707ec7d 518 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 519 }
AzureIoTClient 0:1f9b2707ec7d 520 return result;
AzureIoTClient 0:1f9b2707ec7d 521 }
AzureIoTClient 0:1f9b2707ec7d 522
AzureIoTClient 0:1f9b2707ec7d 523
AzureIoTClient 0:1f9b2707ec7d 524 /*Codes_SRS_SERIALIZER_99_020:[ Create_AGENT_DATA_TYPE_from_SINT32]*/
AzureIoTClient 0:1f9b2707ec7d 525 /*Codes_SRS_SERIALIZER_99_005:[ int], */
AzureIoTClient 0:1f9b2707ec7d 526 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, int)(AGENT_DATA_TYPE* dest, int source)
AzureIoTClient 0:1f9b2707ec7d 527 {
AzureIoTClient 0:1f9b2707ec7d 528 return Create_AGENT_DATA_TYPE_from_SINT32(dest, source);
AzureIoTClient 0:1f9b2707ec7d 529 }
AzureIoTClient 0:1f9b2707ec7d 530
AzureIoTClient 0:1f9b2707ec7d 531 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, int)(const AGENT_DATA_TYPE* agentData, int* dest)
AzureIoTClient 0:1f9b2707ec7d 532 {
AzureIoTClient 0:1f9b2707ec7d 533 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 534 if (agentData->type != EDM_INT32_TYPE)
AzureIoTClient 0:1f9b2707ec7d 535 {
AzureIoTClient 0:1f9b2707ec7d 536 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 537 }
AzureIoTClient 0:1f9b2707ec7d 538 else
AzureIoTClient 0:1f9b2707ec7d 539 {
AzureIoTClient 0:1f9b2707ec7d 540 *dest = agentData->value.edmInt32.value;
AzureIoTClient 0:1f9b2707ec7d 541 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 542 }
AzureIoTClient 0:1f9b2707ec7d 543 return result;
AzureIoTClient 0:1f9b2707ec7d 544 }
AzureIoTClient 0:1f9b2707ec7d 545
AzureIoTClient 0:1f9b2707ec7d 546 /*Codes_SRS_SERIALIZER_99_022:[ Create_AGENT_DATA_TYPE_from_SINT64]*/
AzureIoTClient 0:1f9b2707ec7d 547 /*Codes_SRS_SERIALIZER_99_007:[ long]*/
AzureIoTClient 0:1f9b2707ec7d 548 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, long)(AGENT_DATA_TYPE* dest, long source)
AzureIoTClient 0:1f9b2707ec7d 549 {
AzureIoTClient 0:1f9b2707ec7d 550 return Create_AGENT_DATA_TYPE_from_SINT64(dest, source);
AzureIoTClient 0:1f9b2707ec7d 551 }
AzureIoTClient 0:1f9b2707ec7d 552
AzureIoTClient 0:1f9b2707ec7d 553 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, long)(const AGENT_DATA_TYPE* agentData, long* dest)
AzureIoTClient 0:1f9b2707ec7d 554 {
AzureIoTClient 0:1f9b2707ec7d 555 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 556 if (agentData->type != EDM_INT64_TYPE)
AzureIoTClient 0:1f9b2707ec7d 557 {
AzureIoTClient 0:1f9b2707ec7d 558 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 559 }
AzureIoTClient 0:1f9b2707ec7d 560 else
AzureIoTClient 0:1f9b2707ec7d 561 {
AzureIoTClient 0:1f9b2707ec7d 562 *dest = (long)agentData->value.edmInt64.value;
AzureIoTClient 0:1f9b2707ec7d 563 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 564 }
AzureIoTClient 0:1f9b2707ec7d 565 return result;
AzureIoTClient 0:1f9b2707ec7d 566 }
AzureIoTClient 0:1f9b2707ec7d 567
AzureIoTClient 0:1f9b2707ec7d 568 /*Codes_SRS_SERIALIZER_99_023:[ Create_AGENT_DATA_TYPE_from_SINT8]*/
AzureIoTClient 0:1f9b2707ec7d 569 /*Codes_SRS_SERIALIZER_99_008:[ int8_t]*/
AzureIoTClient 0:1f9b2707ec7d 570 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, int8_t)(AGENT_DATA_TYPE* dest, int8_t source)
AzureIoTClient 0:1f9b2707ec7d 571 {
AzureIoTClient 0:1f9b2707ec7d 572 return Create_AGENT_DATA_TYPE_from_SINT8(dest, source);
AzureIoTClient 0:1f9b2707ec7d 573 }
AzureIoTClient 0:1f9b2707ec7d 574
AzureIoTClient 0:1f9b2707ec7d 575 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, int8_t)(const AGENT_DATA_TYPE* agentData, int8_t* dest)
AzureIoTClient 0:1f9b2707ec7d 576 {
AzureIoTClient 0:1f9b2707ec7d 577 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 578 if (agentData->type != EDM_SBYTE_TYPE)
AzureIoTClient 0:1f9b2707ec7d 579 {
AzureIoTClient 0:1f9b2707ec7d 580 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 581 }
AzureIoTClient 0:1f9b2707ec7d 582 else
AzureIoTClient 0:1f9b2707ec7d 583 {
AzureIoTClient 0:1f9b2707ec7d 584 *dest = agentData->value.edmSbyte.value;
AzureIoTClient 0:1f9b2707ec7d 585 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 586 }
AzureIoTClient 0:1f9b2707ec7d 587 return result;
AzureIoTClient 0:1f9b2707ec7d 588 }
AzureIoTClient 0:1f9b2707ec7d 589
AzureIoTClient 0:1f9b2707ec7d 590 /*Codes_SRS_SERIALIZER_99_024:[ Create_AGENT_DATA_TYPE_from_UINT8]*/
AzureIoTClient 0:1f9b2707ec7d 591 /*Codes_SRS_SERIALIZER_99_009:[ uint8_t]*/
AzureIoTClient 0:1f9b2707ec7d 592 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, uint8_t)(AGENT_DATA_TYPE* dest, uint8_t source)
AzureIoTClient 0:1f9b2707ec7d 593 {
AzureIoTClient 0:1f9b2707ec7d 594 return Create_AGENT_DATA_TYPE_from_UINT8(dest, source);
AzureIoTClient 0:1f9b2707ec7d 595 }
AzureIoTClient 0:1f9b2707ec7d 596
AzureIoTClient 0:1f9b2707ec7d 597 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, uint8_t)(const AGENT_DATA_TYPE* agentData, uint8_t* dest)
AzureIoTClient 0:1f9b2707ec7d 598 {
AzureIoTClient 0:1f9b2707ec7d 599 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 600 if (agentData->type != EDM_BYTE_TYPE)
AzureIoTClient 0:1f9b2707ec7d 601 {
AzureIoTClient 0:1f9b2707ec7d 602 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 603 }
AzureIoTClient 0:1f9b2707ec7d 604 else
AzureIoTClient 0:1f9b2707ec7d 605 {
AzureIoTClient 0:1f9b2707ec7d 606 *dest = agentData->value.edmByte.value;
AzureIoTClient 0:1f9b2707ec7d 607 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 608 }
AzureIoTClient 0:1f9b2707ec7d 609 return result;
AzureIoTClient 0:1f9b2707ec7d 610 }
AzureIoTClient 0:1f9b2707ec7d 611
AzureIoTClient 0:1f9b2707ec7d 612 /*Codes_SRS_SERIALIZER_99_025:[ Create_AGENT_DATA_TYPE_from_SINT16]*/
AzureIoTClient 0:1f9b2707ec7d 613 /*Codes_SRS_SERIALIZER_99_010:[ int16_t]*/
AzureIoTClient 0:1f9b2707ec7d 614 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, int16_t)(AGENT_DATA_TYPE* dest, int16_t source)
AzureIoTClient 0:1f9b2707ec7d 615 {
AzureIoTClient 0:1f9b2707ec7d 616 return Create_AGENT_DATA_TYPE_from_SINT16(dest, source);
AzureIoTClient 0:1f9b2707ec7d 617 }
AzureIoTClient 0:1f9b2707ec7d 618
AzureIoTClient 0:1f9b2707ec7d 619 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, int16_t)(const AGENT_DATA_TYPE* agentData, int16_t* dest)
AzureIoTClient 0:1f9b2707ec7d 620 {
AzureIoTClient 0:1f9b2707ec7d 621 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 622 if (agentData->type != EDM_INT16_TYPE)
AzureIoTClient 0:1f9b2707ec7d 623 {
AzureIoTClient 0:1f9b2707ec7d 624 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 625 }
AzureIoTClient 0:1f9b2707ec7d 626 else
AzureIoTClient 0:1f9b2707ec7d 627 {
AzureIoTClient 0:1f9b2707ec7d 628 *dest = agentData->value.edmInt16.value;
AzureIoTClient 0:1f9b2707ec7d 629 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 630 }
AzureIoTClient 0:1f9b2707ec7d 631 return result;
AzureIoTClient 0:1f9b2707ec7d 632 }
AzureIoTClient 0:1f9b2707ec7d 633
AzureIoTClient 0:1f9b2707ec7d 634 /*Codes_SRS_SERIALIZER_99_026:[ Create_AGENT_DATA_TYPE_from_SINT32]*/
AzureIoTClient 0:1f9b2707ec7d 635 /*Codes_SRS_SERIALIZER_99_011:[ int32_t]*/
AzureIoTClient 0:1f9b2707ec7d 636 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, int32_t)(AGENT_DATA_TYPE* dest, int32_t source)
AzureIoTClient 0:1f9b2707ec7d 637 {
AzureIoTClient 0:1f9b2707ec7d 638 return Create_AGENT_DATA_TYPE_from_SINT32(dest, source);
AzureIoTClient 0:1f9b2707ec7d 639 }
AzureIoTClient 0:1f9b2707ec7d 640
AzureIoTClient 0:1f9b2707ec7d 641 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, int32_t)(const AGENT_DATA_TYPE* agentData, int32_t* dest)
AzureIoTClient 0:1f9b2707ec7d 642 {
AzureIoTClient 0:1f9b2707ec7d 643 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 644 if (agentData->type != EDM_INT32_TYPE)
AzureIoTClient 0:1f9b2707ec7d 645 {
AzureIoTClient 0:1f9b2707ec7d 646 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 647 }
AzureIoTClient 0:1f9b2707ec7d 648 else
AzureIoTClient 0:1f9b2707ec7d 649 {
AzureIoTClient 0:1f9b2707ec7d 650 *dest = agentData->value.edmInt32.value;
AzureIoTClient 0:1f9b2707ec7d 651 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 652 }
AzureIoTClient 0:1f9b2707ec7d 653 return result;
AzureIoTClient 0:1f9b2707ec7d 654 }
AzureIoTClient 0:1f9b2707ec7d 655
AzureIoTClient 0:1f9b2707ec7d 656 /*Codes_SRS_SERIALIZER_99_027:[ Create_AGENT_DATA_TYPE_from_SINT64]*/
AzureIoTClient 0:1f9b2707ec7d 657 /*Codes_SRS_SERIALIZER_99_012:[ int64_t]*/
AzureIoTClient 0:1f9b2707ec7d 658 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, int64_t)(AGENT_DATA_TYPE* dest, int64_t source)
AzureIoTClient 0:1f9b2707ec7d 659 {
AzureIoTClient 0:1f9b2707ec7d 660 return Create_AGENT_DATA_TYPE_from_SINT64(dest, source);
AzureIoTClient 0:1f9b2707ec7d 661 }
AzureIoTClient 0:1f9b2707ec7d 662
AzureIoTClient 0:1f9b2707ec7d 663 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, int64_t)(const AGENT_DATA_TYPE* agentData, int64_t* dest)
AzureIoTClient 0:1f9b2707ec7d 664 {
AzureIoTClient 0:1f9b2707ec7d 665 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 666 if (agentData->type != EDM_INT64_TYPE)
AzureIoTClient 0:1f9b2707ec7d 667 {
AzureIoTClient 0:1f9b2707ec7d 668 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 669 }
AzureIoTClient 0:1f9b2707ec7d 670 else
AzureIoTClient 0:1f9b2707ec7d 671 {
AzureIoTClient 0:1f9b2707ec7d 672 *dest = agentData->value.edmInt64.value;
AzureIoTClient 0:1f9b2707ec7d 673 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 674 }
AzureIoTClient 0:1f9b2707ec7d 675 return result;
AzureIoTClient 0:1f9b2707ec7d 676 }
AzureIoTClient 0:1f9b2707ec7d 677
AzureIoTClient 0:1f9b2707ec7d 678 /*Codes_SRS_SERIALIZER_99_013:[ bool]*/
AzureIoTClient 0:1f9b2707ec7d 679 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, bool)(AGENT_DATA_TYPE* dest, bool source)
AzureIoTClient 0:1f9b2707ec7d 680 {
AzureIoTClient 0:1f9b2707ec7d 681 return Create_EDM_BOOLEAN_from_int(dest, source == true);
AzureIoTClient 0:1f9b2707ec7d 682 }
AzureIoTClient 0:1f9b2707ec7d 683
AzureIoTClient 0:1f9b2707ec7d 684 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, bool)(const AGENT_DATA_TYPE* agentData, bool* dest)
AzureIoTClient 0:1f9b2707ec7d 685 {
AzureIoTClient 0:1f9b2707ec7d 686 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 687 if (agentData->type != EDM_BOOLEAN_TYPE)
AzureIoTClient 0:1f9b2707ec7d 688 {
AzureIoTClient 0:1f9b2707ec7d 689 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 690 }
AzureIoTClient 0:1f9b2707ec7d 691 else
AzureIoTClient 0:1f9b2707ec7d 692 {
AzureIoTClient 0:1f9b2707ec7d 693 *dest = (agentData->value.edmBoolean.value == EDM_TRUE) ? true : false;
AzureIoTClient 0:1f9b2707ec7d 694 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 695 }
AzureIoTClient 0:1f9b2707ec7d 696 return result;
AzureIoTClient 0:1f9b2707ec7d 697 }
AzureIoTClient 0:1f9b2707ec7d 698
AzureIoTClient 0:1f9b2707ec7d 699 /*Codes_SRS_SERIALIZER_99_014:[ ascii_char_ptr]*/
AzureIoTClient 0:1f9b2707ec7d 700 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, ascii_char_ptr)(AGENT_DATA_TYPE* dest, ascii_char_ptr source)
AzureIoTClient 0:1f9b2707ec7d 701 {
AzureIoTClient 0:1f9b2707ec7d 702 return Create_AGENT_DATA_TYPE_from_charz(dest, source);
AzureIoTClient 0:1f9b2707ec7d 703 }
AzureIoTClient 0:1f9b2707ec7d 704
AzureIoTClient 0:1f9b2707ec7d 705 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, ascii_char_ptr)(const AGENT_DATA_TYPE* agentData, ascii_char_ptr* dest)
AzureIoTClient 0:1f9b2707ec7d 706 {
AzureIoTClient 0:1f9b2707ec7d 707 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 708 if (agentData->type != EDM_STRING_TYPE)
AzureIoTClient 0:1f9b2707ec7d 709 {
AzureIoTClient 0:1f9b2707ec7d 710 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 711 }
AzureIoTClient 0:1f9b2707ec7d 712 else
AzureIoTClient 0:1f9b2707ec7d 713 {
AzureIoTClient 0:1f9b2707ec7d 714 *dest = agentData->value.edmString.chars;
AzureIoTClient 0:1f9b2707ec7d 715 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 716 }
AzureIoTClient 0:1f9b2707ec7d 717 return result;
AzureIoTClient 0:1f9b2707ec7d 718 }
AzureIoTClient 0:1f9b2707ec7d 719
AzureIoTClient 0:1f9b2707ec7d 720 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, ascii_char_ptr_no_quotes)(AGENT_DATA_TYPE* dest, ascii_char_ptr_no_quotes source)
AzureIoTClient 0:1f9b2707ec7d 721 {
AzureIoTClient 0:1f9b2707ec7d 722 return Create_AGENT_DATA_TYPE_from_charz_no_quotes(dest, source);
AzureIoTClient 0:1f9b2707ec7d 723 }
AzureIoTClient 0:1f9b2707ec7d 724
AzureIoTClient 0:1f9b2707ec7d 725 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, ascii_char_ptr_no_quotes)(const AGENT_DATA_TYPE* agentData, ascii_char_ptr_no_quotes* dest)
AzureIoTClient 0:1f9b2707ec7d 726 {
AzureIoTClient 0:1f9b2707ec7d 727 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 728 if (agentData->type != EDM_STRING_NO_QUOTES_TYPE)
AzureIoTClient 0:1f9b2707ec7d 729 {
AzureIoTClient 0:1f9b2707ec7d 730 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 731 }
AzureIoTClient 0:1f9b2707ec7d 732 else
AzureIoTClient 0:1f9b2707ec7d 733 {
AzureIoTClient 0:1f9b2707ec7d 734 *dest = agentData->value.edmStringNoQuotes.chars;
AzureIoTClient 0:1f9b2707ec7d 735 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 736 }
AzureIoTClient 0:1f9b2707ec7d 737 return result;
AzureIoTClient 0:1f9b2707ec7d 738 }
AzureIoTClient 0:1f9b2707ec7d 739
AzureIoTClient 0:1f9b2707ec7d 740 /*Codes_SRS_SERIALIZER_99_051:[ EDM_DATE_TIME_OFFSET*/
AzureIoTClient 0:1f9b2707ec7d 741 /*Codes_SRS_SERIALIZER_99_053:[Create_AGENT_DATA_TYPE_from_EDM_DATE_TIME_OFFSET]*/
AzureIoTClient 0:1f9b2707ec7d 742 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, EDM_DATE_TIME_OFFSET)(AGENT_DATA_TYPE* dest, EDM_DATE_TIME_OFFSET source)
AzureIoTClient 0:1f9b2707ec7d 743 {
AzureIoTClient 0:1f9b2707ec7d 744 return Create_AGENT_DATA_TYPE_from_EDM_DATE_TIME_OFFSET(dest, source);
AzureIoTClient 0:1f9b2707ec7d 745 }
AzureIoTClient 0:1f9b2707ec7d 746
AzureIoTClient 0:1f9b2707ec7d 747 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, EDM_DATE_TIME_OFFSET)(const AGENT_DATA_TYPE* agentData, EDM_DATE_TIME_OFFSET* dest)
AzureIoTClient 0:1f9b2707ec7d 748 {
AzureIoTClient 0:1f9b2707ec7d 749 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 750 if (agentData->type != EDM_DATE_TIME_OFFSET_TYPE)
AzureIoTClient 0:1f9b2707ec7d 751 {
AzureIoTClient 0:1f9b2707ec7d 752 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 753 }
AzureIoTClient 0:1f9b2707ec7d 754 else
AzureIoTClient 0:1f9b2707ec7d 755 {
AzureIoTClient 0:1f9b2707ec7d 756 *dest = agentData->value.edmDateTimeOffset;
AzureIoTClient 0:1f9b2707ec7d 757 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 758 }
AzureIoTClient 0:1f9b2707ec7d 759 return result;
AzureIoTClient 0:1f9b2707ec7d 760 }
AzureIoTClient 0:1f9b2707ec7d 761
AzureIoTClient 0:1f9b2707ec7d 762 /*Codes_SRS_SERIALIZER_99_072:[ EDM_GUID]*/
AzureIoTClient 0:1f9b2707ec7d 763 /*Codes_SRS_SERIALIZER_99_073:[ Create_AGENT_DATA_TYPE_from_EDM_GUID]*/
AzureIoTClient 0:1f9b2707ec7d 764 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, EDM_GUID)(AGENT_DATA_TYPE* dest, EDM_GUID guid)
AzureIoTClient 0:1f9b2707ec7d 765 {
AzureIoTClient 0:1f9b2707ec7d 766 return Create_AGENT_DATA_TYPE_from_EDM_GUID(dest, guid);
AzureIoTClient 0:1f9b2707ec7d 767 }
AzureIoTClient 0:1f9b2707ec7d 768
AzureIoTClient 0:1f9b2707ec7d 769 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, EDM_GUID)(const AGENT_DATA_TYPE* agentData, EDM_GUID* dest)
AzureIoTClient 0:1f9b2707ec7d 770 {
AzureIoTClient 0:1f9b2707ec7d 771 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 772 if (agentData->type != EDM_GUID_TYPE)
AzureIoTClient 0:1f9b2707ec7d 773 {
AzureIoTClient 0:1f9b2707ec7d 774 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 775 }
AzureIoTClient 0:1f9b2707ec7d 776 else
AzureIoTClient 0:1f9b2707ec7d 777 {
AzureIoTClient 0:1f9b2707ec7d 778 memcpy(dest->GUID, agentData->value.edmGuid.GUID, 16);
AzureIoTClient 0:1f9b2707ec7d 779 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 780 }
AzureIoTClient 0:1f9b2707ec7d 781 return result;
AzureIoTClient 0:1f9b2707ec7d 782 }
AzureIoTClient 0:1f9b2707ec7d 783
AzureIoTClient 0:1f9b2707ec7d 784 /*Codes_SRS_SERIALIZER_99_074:[ EDM_BINARY]*/
AzureIoTClient 0:1f9b2707ec7d 785 /*Codes_SRS_SERIALIZER_99_075:[ Create_AGENT_DATA_TYPE_from_EDM_BINARY]*/
AzureIoTClient 0:1f9b2707ec7d 786 static AGENT_DATA_TYPES_RESULT C2(ToAGENT_DATA_TYPE_, EDM_BINARY)(AGENT_DATA_TYPE* dest, EDM_BINARY edmBinary)
AzureIoTClient 0:1f9b2707ec7d 787 {
AzureIoTClient 0:1f9b2707ec7d 788 return Create_AGENT_DATA_TYPE_from_EDM_BINARY(dest, edmBinary);
AzureIoTClient 0:1f9b2707ec7d 789 }
AzureIoTClient 0:1f9b2707ec7d 790
AzureIoTClient 0:1f9b2707ec7d 791 static AGENT_DATA_TYPES_RESULT C2(FromAGENT_DATA_TYPE_, EDM_BINARY)(const AGENT_DATA_TYPE* agentData, EDM_BINARY* dest)
AzureIoTClient 0:1f9b2707ec7d 792 {
AzureIoTClient 0:1f9b2707ec7d 793 AGENT_DATA_TYPES_RESULT result;
AzureIoTClient 0:1f9b2707ec7d 794 if (agentData->type != EDM_BINARY_TYPE)
AzureIoTClient 0:1f9b2707ec7d 795 {
AzureIoTClient 0:1f9b2707ec7d 796 result = AGENT_DATA_TYPES_INVALID_ARG;
AzureIoTClient 0:1f9b2707ec7d 797 }
AzureIoTClient 0:1f9b2707ec7d 798 else
AzureIoTClient 0:1f9b2707ec7d 799 {
AzureIoTClient 0:1f9b2707ec7d 800 if ((dest->data = (unsigned char *)malloc(agentData->value.edmBinary.size)) == NULL) /*cast because this get included in a C++ file.*/
AzureIoTClient 0:1f9b2707ec7d 801 {
AzureIoTClient 0:1f9b2707ec7d 802 result = AGENT_DATA_TYPES_ERROR;
AzureIoTClient 0:1f9b2707ec7d 803 }
AzureIoTClient 0:1f9b2707ec7d 804 else
AzureIoTClient 0:1f9b2707ec7d 805 {
AzureIoTClient 0:1f9b2707ec7d 806 memcpy(dest->data, agentData->value.edmBinary.data, agentData->value.edmBinary.size);
AzureIoTClient 0:1f9b2707ec7d 807 dest->size = agentData->value.edmBinary.size;
AzureIoTClient 0:1f9b2707ec7d 808 result = AGENT_DATA_TYPES_OK;
AzureIoTClient 0:1f9b2707ec7d 809 }
AzureIoTClient 0:1f9b2707ec7d 810 }
AzureIoTClient 0:1f9b2707ec7d 811 return result;
AzureIoTClient 0:1f9b2707ec7d 812 }
AzureIoTClient 0:1f9b2707ec7d 813
AzureIoTClient 0:1f9b2707ec7d 814 static void C2(destroyLocalParameter, EDM_BINARY)(EDM_BINARY* value)
AzureIoTClient 0:1f9b2707ec7d 815 {
AzureIoTClient 0:1f9b2707ec7d 816 if (value != NULL)
AzureIoTClient 0:1f9b2707ec7d 817 {
AzureIoTClient 0:1f9b2707ec7d 818 free(value->data);
AzureIoTClient 0:1f9b2707ec7d 819 value->data = NULL;
AzureIoTClient 0:1f9b2707ec7d 820 value->size = 0;
AzureIoTClient 0:1f9b2707ec7d 821 }
AzureIoTClient 0:1f9b2707ec7d 822 }
AzureIoTClient 0:1f9b2707ec7d 823
AzureIoTClient 0:1f9b2707ec7d 824 static void C2(destroyLocalParameter, EDM_BOOLEAN)(EDM_BOOLEAN* value)
AzureIoTClient 0:1f9b2707ec7d 825 {
AzureIoTClient 0:1f9b2707ec7d 826 (void)value;
AzureIoTClient 0:1f9b2707ec7d 827 }
AzureIoTClient 0:1f9b2707ec7d 828
AzureIoTClient 0:1f9b2707ec7d 829 static void C2(destroyLocalParameter, EDM_BYTE)(EDM_BYTE* value)
AzureIoTClient 0:1f9b2707ec7d 830 {
AzureIoTClient 0:1f9b2707ec7d 831 (void)value;
AzureIoTClient 0:1f9b2707ec7d 832 }
AzureIoTClient 0:1f9b2707ec7d 833
AzureIoTClient 0:1f9b2707ec7d 834 static void C2(destroyLocalParameter, EDM_DATE)(EDM_DATE* value)
AzureIoTClient 0:1f9b2707ec7d 835 {
AzureIoTClient 0:1f9b2707ec7d 836 (void)value;
AzureIoTClient 0:1f9b2707ec7d 837 }
AzureIoTClient 0:1f9b2707ec7d 838
AzureIoTClient 0:1f9b2707ec7d 839 static void C2(destroyLocalParameter, EDM_DATE_TIME_OFFSET)(EDM_DATE_TIME_OFFSET* value)
AzureIoTClient 0:1f9b2707ec7d 840 {
AzureIoTClient 0:1f9b2707ec7d 841 (void)value;
AzureIoTClient 0:1f9b2707ec7d 842 }
AzureIoTClient 0:1f9b2707ec7d 843
AzureIoTClient 0:1f9b2707ec7d 844 static void C2(destroyLocalParameter, EDM_DECIMAL)(EDM_DECIMAL* value)
AzureIoTClient 0:1f9b2707ec7d 845 {
AzureIoTClient 0:1f9b2707ec7d 846 if (value != NULL)
AzureIoTClient 0:1f9b2707ec7d 847 {
AzureIoTClient 0:1f9b2707ec7d 848 STRING_delete(value->value);
AzureIoTClient 0:1f9b2707ec7d 849 value->value = NULL;
AzureIoTClient 0:1f9b2707ec7d 850 }
AzureIoTClient 0:1f9b2707ec7d 851 }
AzureIoTClient 0:1f9b2707ec7d 852
AzureIoTClient 0:1f9b2707ec7d 853 static void C2(destroyLocalParameter, EDM_DOUBLE)(EDM_DOUBLE* value)
AzureIoTClient 0:1f9b2707ec7d 854 {
AzureIoTClient 0:1f9b2707ec7d 855 (void)value;
AzureIoTClient 0:1f9b2707ec7d 856 }
AzureIoTClient 0:1f9b2707ec7d 857
AzureIoTClient 0:1f9b2707ec7d 858 static void C2(destroyLocalParameter, EDM_DURATION)(EDM_DURATION* value)
AzureIoTClient 0:1f9b2707ec7d 859 {
AzureIoTClient 0:1f9b2707ec7d 860 if (value != NULL)
AzureIoTClient 0:1f9b2707ec7d 861 {
AzureIoTClient 0:1f9b2707ec7d 862 free(value->digits);
AzureIoTClient 0:1f9b2707ec7d 863 value->digits = NULL;
AzureIoTClient 0:1f9b2707ec7d 864 value->nDigits = 0;
AzureIoTClient 0:1f9b2707ec7d 865 }
AzureIoTClient 0:1f9b2707ec7d 866 }
AzureIoTClient 0:1f9b2707ec7d 867
AzureIoTClient 0:1f9b2707ec7d 868 static void C2(destroyLocalParameter, EDM_GUID)(EDM_GUID* value)
AzureIoTClient 0:1f9b2707ec7d 869 {
AzureIoTClient 0:1f9b2707ec7d 870 (void)value;
AzureIoTClient 0:1f9b2707ec7d 871 }
AzureIoTClient 0:1f9b2707ec7d 872
AzureIoTClient 0:1f9b2707ec7d 873 static void C2(destroyLocalParameter, EDM_INT16)(EDM_INT16* value)
AzureIoTClient 0:1f9b2707ec7d 874 {
AzureIoTClient 0:1f9b2707ec7d 875 (void)value;
AzureIoTClient 0:1f9b2707ec7d 876 }
AzureIoTClient 0:1f9b2707ec7d 877
AzureIoTClient 0:1f9b2707ec7d 878 static void C2(destroyLocalParameter, EDM_INT32)(EDM_INT32* value)
AzureIoTClient 0:1f9b2707ec7d 879 {
AzureIoTClient 0:1f9b2707ec7d 880 (void)value;
AzureIoTClient 0:1f9b2707ec7d 881 }
AzureIoTClient 0:1f9b2707ec7d 882
AzureIoTClient 0:1f9b2707ec7d 883 static void C2(destroyLocalParameter, EDM_INT64)(EDM_INT64* value)
AzureIoTClient 0:1f9b2707ec7d 884 {
AzureIoTClient 0:1f9b2707ec7d 885 (void)value;
AzureIoTClient 0:1f9b2707ec7d 886 }
AzureIoTClient 0:1f9b2707ec7d 887
AzureIoTClient 0:1f9b2707ec7d 888 static void C2(destroyLocalParameter, EDM_SBYTE)(EDM_SBYTE* value)
AzureIoTClient 0:1f9b2707ec7d 889 {
AzureIoTClient 0:1f9b2707ec7d 890 (void)value;
AzureIoTClient 0:1f9b2707ec7d 891 }
AzureIoTClient 0:1f9b2707ec7d 892
AzureIoTClient 0:1f9b2707ec7d 893 static void C2(destroyLocalParameter, EDM_SINGLE)(EDM_SINGLE* value)
AzureIoTClient 0:1f9b2707ec7d 894 {
AzureIoTClient 0:1f9b2707ec7d 895 (void)value;
AzureIoTClient 0:1f9b2707ec7d 896 }
AzureIoTClient 0:1f9b2707ec7d 897
AzureIoTClient 0:1f9b2707ec7d 898 static void C2(destroyLocalParameter, EDM_STRING)(EDM_STRING* value)
AzureIoTClient 0:1f9b2707ec7d 899 {
AzureIoTClient 0:1f9b2707ec7d 900 (void)value;
AzureIoTClient 0:1f9b2707ec7d 901 }
AzureIoTClient 0:1f9b2707ec7d 902
AzureIoTClient 0:1f9b2707ec7d 903
AzureIoTClient 0:1f9b2707ec7d 904 static void C2(destroyLocalParameter, EDM_TIME_OF_DAY)(EDM_TIME_OF_DAY* value)
AzureIoTClient 0:1f9b2707ec7d 905 {
AzureIoTClient 0:1f9b2707ec7d 906 (void)value;
AzureIoTClient 0:1f9b2707ec7d 907 }
AzureIoTClient 0:1f9b2707ec7d 908
AzureIoTClient 0:1f9b2707ec7d 909 static void C2(destroyLocalParameter, int)(int* value)
AzureIoTClient 0:1f9b2707ec7d 910 {
AzureIoTClient 0:1f9b2707ec7d 911 (void)value;
AzureIoTClient 0:1f9b2707ec7d 912 }
AzureIoTClient 0:1f9b2707ec7d 913
AzureIoTClient 0:1f9b2707ec7d 914 static void C2(destroyLocalParameter, float)(float* value)
AzureIoTClient 0:1f9b2707ec7d 915 {
AzureIoTClient 0:1f9b2707ec7d 916 (void)value;
AzureIoTClient 0:1f9b2707ec7d 917 }
AzureIoTClient 0:1f9b2707ec7d 918
AzureIoTClient 0:1f9b2707ec7d 919 static void C2(destroyLocalParameter, double)(double* value)
AzureIoTClient 0:1f9b2707ec7d 920 {
AzureIoTClient 0:1f9b2707ec7d 921 (void)value;
AzureIoTClient 0:1f9b2707ec7d 922 }
AzureIoTClient 0:1f9b2707ec7d 923
AzureIoTClient 0:1f9b2707ec7d 924 static void C2(destroyLocalParameter, long)(long* value)
AzureIoTClient 0:1f9b2707ec7d 925 {
AzureIoTClient 0:1f9b2707ec7d 926 (void)value;
AzureIoTClient 0:1f9b2707ec7d 927 }
AzureIoTClient 0:1f9b2707ec7d 928
AzureIoTClient 0:1f9b2707ec7d 929 static void C2(destroyLocalParameter, int8_t)(int8_t* value)
AzureIoTClient 0:1f9b2707ec7d 930 {
AzureIoTClient 0:1f9b2707ec7d 931 (void)value;
AzureIoTClient 0:1f9b2707ec7d 932 }
AzureIoTClient 0:1f9b2707ec7d 933
AzureIoTClient 0:1f9b2707ec7d 934 static void C2(destroyLocalParameter, uint8_t)(uint8_t* value)
AzureIoTClient 0:1f9b2707ec7d 935 {
AzureIoTClient 0:1f9b2707ec7d 936 (void)value;
AzureIoTClient 0:1f9b2707ec7d 937 }
AzureIoTClient 0:1f9b2707ec7d 938
AzureIoTClient 0:1f9b2707ec7d 939 static void C2(destroyLocalParameter, int16_t)(int16_t* value)
AzureIoTClient 0:1f9b2707ec7d 940 {
AzureIoTClient 0:1f9b2707ec7d 941 (void)value;
AzureIoTClient 0:1f9b2707ec7d 942 }
AzureIoTClient 0:1f9b2707ec7d 943
AzureIoTClient 0:1f9b2707ec7d 944 static void C2(destroyLocalParameter, int32_t)(int32_t* value)
AzureIoTClient 0:1f9b2707ec7d 945 {
AzureIoTClient 0:1f9b2707ec7d 946 (void)value;
AzureIoTClient 0:1f9b2707ec7d 947 }
AzureIoTClient 0:1f9b2707ec7d 948
AzureIoTClient 0:1f9b2707ec7d 949 static void C2(destroyLocalParameter, int64_t)(int64_t* value)
AzureIoTClient 0:1f9b2707ec7d 950 {
AzureIoTClient 0:1f9b2707ec7d 951 (void)value;
AzureIoTClient 0:1f9b2707ec7d 952 }
AzureIoTClient 0:1f9b2707ec7d 953
AzureIoTClient 0:1f9b2707ec7d 954 static void C2(destroyLocalParameter, bool)(bool* value)
AzureIoTClient 0:1f9b2707ec7d 955 {
AzureIoTClient 0:1f9b2707ec7d 956 (void)value;
AzureIoTClient 0:1f9b2707ec7d 957 }
AzureIoTClient 0:1f9b2707ec7d 958
AzureIoTClient 0:1f9b2707ec7d 959 static void C2(destroyLocalParameter, ascii_char_ptr)(ascii_char_ptr* value)
AzureIoTClient 0:1f9b2707ec7d 960 {
AzureIoTClient 0:1f9b2707ec7d 961 (void)value;
AzureIoTClient 0:1f9b2707ec7d 962 }
AzureIoTClient 0:1f9b2707ec7d 963
AzureIoTClient 0:1f9b2707ec7d 964 static void C2(destroyLocalParameter, ascii_char_ptr_no_quotes)(ascii_char_ptr_no_quotes* value)
AzureIoTClient 0:1f9b2707ec7d 965 {
AzureIoTClient 0:1f9b2707ec7d 966 (void)value;
AzureIoTClient 0:1f9b2707ec7d 967 }
AzureIoTClient 0:1f9b2707ec7d 968
AzureIoTClient 0:1f9b2707ec7d 969 #ifdef __cplusplus
AzureIoTClient 0:1f9b2707ec7d 970 }
AzureIoTClient 0:1f9b2707ec7d 971 #endif
AzureIoTClient 0:1f9b2707ec7d 972
AzureIoTClient 0:1f9b2707ec7d 973 #endif /*SERIALIZER_H*/
AzureIoTClient 0:1f9b2707ec7d 974
AzureIoTClient 0:1f9b2707ec7d 975