Remote monitoring IoTHub device sample Added real SHTx sensor to get temperature and humidity Added new command to set temperature scale change Removed "mock" commands to set temperature and humidity values It's configured to work on FRDM-K64F board

Dependencies:   EthernetInterface NTPClient SHTx iothub_amqp_transport iothub_client mbed-rtos mbed proton-c-mbed serializer wolfSSL

Fork of remote_monitoring by Azure IoT

Committer:
ppatierno
Date:
Sun Nov 15 15:34:16 2015 +0000
Revision:
23:e37e4e321690
Parent:
22:afe08a0ed332
Added real SHTx sensor to get temperature and humidity; Added new command to set temperature scale change; Removed "mock" commands to set temperature and humidity values

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzureIoTClient 20:ea66de0f1a06 1 // Copyright (c) Microsoft. All rights reserved.
AzureIoTClient 20:ea66de0f1a06 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
AzureIoTClient 20:ea66de0f1a06 3
AzureIoTClient 20:ea66de0f1a06 4 #include "iothubtransportamqp.h"
AzureIoTClient 20:ea66de0f1a06 5 #include "schemalib.h"
AzureIoTClient 20:ea66de0f1a06 6 #include "iothub_client.h"
AzureIoTClient 20:ea66de0f1a06 7 #include "serializer.h"
AzureIoTClient 20:ea66de0f1a06 8 #include "schemaserializer.h"
AzureIoTClient 20:ea66de0f1a06 9 #include "threadapi.h"
AzureIoTClient 20:ea66de0f1a06 10
AzureIoTClient 20:ea66de0f1a06 11 #ifdef MBED_BUILD_TIMESTAMP
AzureIoTClient 20:ea66de0f1a06 12 #include "certs.h"
AzureIoTClient 20:ea66de0f1a06 13 #endif // MBED_BUILD_TIMESTAMP
AzureIoTClient 20:ea66de0f1a06 14
ppatierno 23:e37e4e321690 15 #include "SHTx/sht15_export.h"
ppatierno 23:e37e4e321690 16
ppatierno 23:e37e4e321690 17 /*
AzureIoTClient 20:ea66de0f1a06 18 static const char* deviceId = "[Device Id]";
AzureIoTClient 20:ea66de0f1a06 19 static const char* deviceKey = "[Device Key]";
AzureIoTClient 20:ea66de0f1a06 20 static const char* hubName = "[IoTHub Name]";
AzureIoTClient 20:ea66de0f1a06 21 static const char* hubSuffix = "[IoTHub Suffix, i.e. azure-devices.net]";
ppatierno 23:e37e4e321690 22 */
ppatierno 23:e37e4e321690 23
ppatierno 23:e37e4e321690 24 static const char* deviceId = "frdm-k64f";
ppatierno 23:e37e4e321690 25 static const char* deviceKey = "BoiNPBlt1odSFfl/wQQtrrzuBLBGeqTqpiOsRKBecus=";
ppatierno 23:e37e4e321690 26 static const char* hubName = "ppatiernoiothub";
ppatierno 23:e37e4e321690 27 static const char* hubSuffix = "azure-devices.net";
AzureIoTClient 20:ea66de0f1a06 28
AzureIoTClient 20:ea66de0f1a06 29 // Define the Model
AzureIoTClient 20:ea66de0f1a06 30 BEGIN_NAMESPACE(Contoso);
AzureIoTClient 20:ea66de0f1a06 31
AzureIoTClient 20:ea66de0f1a06 32 DECLARE_STRUCT(SystemProperties,
AzureIoTClient 20:ea66de0f1a06 33 ascii_char_ptr, DeviceID,
AzureIoTClient 20:ea66de0f1a06 34 _Bool, Enabled
AzureIoTClient 20:ea66de0f1a06 35 );
AzureIoTClient 20:ea66de0f1a06 36
AzureIoTClient 20:ea66de0f1a06 37 DECLARE_STRUCT(DeviceProperties,
AzureIoTClient 20:ea66de0f1a06 38 ascii_char_ptr, DeviceID,
AzureIoTClient 20:ea66de0f1a06 39 _Bool, HubEnabledState
AzureIoTClient 20:ea66de0f1a06 40 );
AzureIoTClient 20:ea66de0f1a06 41
AzureIoTClient 20:ea66de0f1a06 42 DECLARE_MODEL(Thermostat,
AzureIoTClient 20:ea66de0f1a06 43
AzureIoTClient 20:ea66de0f1a06 44 /* Event data (temperature, external temperature and humidity) */
AzureIoTClient 20:ea66de0f1a06 45 WITH_DATA(double, Temperature),
AzureIoTClient 20:ea66de0f1a06 46 WITH_DATA(double, ExternalTemperature),
AzureIoTClient 20:ea66de0f1a06 47 WITH_DATA(double, Humidity),
AzureIoTClient 20:ea66de0f1a06 48 WITH_DATA(ascii_char_ptr, DeviceId),
AzureIoTClient 20:ea66de0f1a06 49
AzureIoTClient 20:ea66de0f1a06 50 /* Device Info - This is command metadata + some extra fields */
AzureIoTClient 20:ea66de0f1a06 51 WITH_DATA(ascii_char_ptr, ObjectType),
AzureIoTClient 20:ea66de0f1a06 52 WITH_DATA(_Bool, IsSimulatedDevice),
AzureIoTClient 20:ea66de0f1a06 53 WITH_DATA(ascii_char_ptr, Version),
AzureIoTClient 20:ea66de0f1a06 54 WITH_DATA(DeviceProperties, DeviceProperties),
AzureIoTClient 20:ea66de0f1a06 55 WITH_DATA(ascii_char_ptr_no_quotes, Commands),
AzureIoTClient 20:ea66de0f1a06 56
AzureIoTClient 20:ea66de0f1a06 57 /* Commands implemented by the device */
ppatierno 23:e37e4e321690 58 //WITH_ACTION(SetTemperature, double, temperature),
ppatierno 23:e37e4e321690 59 //WITH_ACTION(SetHumidity, double, humidity)
ppatierno 23:e37e4e321690 60 WITH_ACTION(SetScale, bool, scale)
AzureIoTClient 20:ea66de0f1a06 61 );
AzureIoTClient 20:ea66de0f1a06 62
AzureIoTClient 20:ea66de0f1a06 63 END_NAMESPACE(Contoso);
AzureIoTClient 20:ea66de0f1a06 64
ppatierno 23:e37e4e321690 65 // { "Name" : "SetScale", "Parameters": { "scale" : false } }
ppatierno 23:e37e4e321690 66 EXECUTE_COMMAND_RESULT SetScale(Thermostat* thermostat, bool scale)
ppatierno 23:e37e4e321690 67 {
ppatierno 23:e37e4e321690 68 (void)printf("Received scale %d\r\n", scale);
ppatierno 23:e37e4e321690 69 SHT15_setScale(scale);
ppatierno 23:e37e4e321690 70 return EXECUTE_COMMAND_SUCCESS;
ppatierno 23:e37e4e321690 71 }
ppatierno 23:e37e4e321690 72
ppatierno 23:e37e4e321690 73 /*
ppatierno 23:e37e4e321690 74 // { "Name" : "SetTemperature", "Parameters": { "temperature" : 10 } }
AzureIoTClient 20:ea66de0f1a06 75 EXECUTE_COMMAND_RESULT SetTemperature(Thermostat* thermostat, double temperature)
AzureIoTClient 20:ea66de0f1a06 76 {
AzureIoTClient 20:ea66de0f1a06 77 (void)printf("Received temperature %.02fs\r\n", temperature);
AzureIoTClient 20:ea66de0f1a06 78 thermostat->Temperature = temperature;
AzureIoTClient 20:ea66de0f1a06 79 return EXECUTE_COMMAND_SUCCESS;
AzureIoTClient 20:ea66de0f1a06 80 }
AzureIoTClient 20:ea66de0f1a06 81
ppatierno 23:e37e4e321690 82 // { "Name" : "SetHumidity", "Parameters": { "humidity" : 20 } }
AzureIoTClient 20:ea66de0f1a06 83 EXECUTE_COMMAND_RESULT SetHumidity(Thermostat* thermostat, double humidity)
AzureIoTClient 20:ea66de0f1a06 84 {
AzureIoTClient 20:ea66de0f1a06 85 (void)printf("Received humidity %.02fs\r\n", humidity);
AzureIoTClient 20:ea66de0f1a06 86 thermostat->Humidity = humidity;
AzureIoTClient 20:ea66de0f1a06 87 return EXECUTE_COMMAND_SUCCESS;
AzureIoTClient 20:ea66de0f1a06 88 }
ppatierno 23:e37e4e321690 89 */
AzureIoTClient 20:ea66de0f1a06 90
AzureIoTClient 20:ea66de0f1a06 91 static void sendMessage(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const unsigned char* buffer, size_t size)
AzureIoTClient 20:ea66de0f1a06 92 {
AzureIoTClient 20:ea66de0f1a06 93 IOTHUB_MESSAGE_HANDLE messageHandle = IoTHubMessage_CreateFromByteArray(buffer, size);
AzureIoTClient 20:ea66de0f1a06 94 if (messageHandle == NULL)
AzureIoTClient 20:ea66de0f1a06 95 {
AzureIoTClient 20:ea66de0f1a06 96 printf("unable to create a new IoTHubMessage\r\n");
AzureIoTClient 20:ea66de0f1a06 97 }
AzureIoTClient 20:ea66de0f1a06 98 else
AzureIoTClient 20:ea66de0f1a06 99 {
AzureIoTClient 20:ea66de0f1a06 100 if (IoTHubClient_SendEventAsync(iotHubClientHandle, messageHandle, NULL, NULL) != IOTHUB_CLIENT_OK)
AzureIoTClient 20:ea66de0f1a06 101 {
AzureIoTClient 20:ea66de0f1a06 102 printf("failed to hand over the message to IoTHubClient");
AzureIoTClient 20:ea66de0f1a06 103 }
AzureIoTClient 20:ea66de0f1a06 104 else
AzureIoTClient 20:ea66de0f1a06 105 {
AzureIoTClient 20:ea66de0f1a06 106 printf("IoTHubClient accepted the message for delivery\r\n");
AzureIoTClient 20:ea66de0f1a06 107 }
AzureIoTClient 20:ea66de0f1a06 108
AzureIoTClient 20:ea66de0f1a06 109 IoTHubMessage_Destroy(messageHandle);
AzureIoTClient 20:ea66de0f1a06 110 }
AzureIoTClient 20:ea66de0f1a06 111 free((void*)buffer);
AzureIoTClient 20:ea66de0f1a06 112 }
AzureIoTClient 20:ea66de0f1a06 113
AzureIoTClient 20:ea66de0f1a06 114 /*this function "links" IoTHub to the serialization library*/
AzureIoTClient 20:ea66de0f1a06 115 static IOTHUBMESSAGE_DISPOSITION_RESULT IoTHubMessage(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback)
AzureIoTClient 20:ea66de0f1a06 116 {
AzureIoTClient 20:ea66de0f1a06 117 IOTHUBMESSAGE_DISPOSITION_RESULT result;
AzureIoTClient 20:ea66de0f1a06 118 const unsigned char* buffer;
AzureIoTClient 20:ea66de0f1a06 119 size_t size;
AzureIoTClient 20:ea66de0f1a06 120 if (IoTHubMessage_GetByteArray(message, &buffer, &size) != IOTHUB_MESSAGE_OK)
AzureIoTClient 20:ea66de0f1a06 121 {
AzureIoTClient 20:ea66de0f1a06 122 printf("unable to IoTHubMessage_GetByteArray\r\n");
AzureIoTClient 20:ea66de0f1a06 123 result = EXECUTE_COMMAND_ERROR;
AzureIoTClient 20:ea66de0f1a06 124 }
AzureIoTClient 20:ea66de0f1a06 125 else
AzureIoTClient 20:ea66de0f1a06 126 {
AzureIoTClient 20:ea66de0f1a06 127 /*buffer is not zero terminated*/
AzureIoTClient 20:ea66de0f1a06 128 char* temp = malloc(size + 1);
AzureIoTClient 20:ea66de0f1a06 129 if (temp == NULL)
AzureIoTClient 20:ea66de0f1a06 130 {
AzureIoTClient 20:ea66de0f1a06 131 printf("failed to malloc\r\n");
AzureIoTClient 20:ea66de0f1a06 132 result = EXECUTE_COMMAND_ERROR;
AzureIoTClient 20:ea66de0f1a06 133 }
AzureIoTClient 20:ea66de0f1a06 134 else
AzureIoTClient 20:ea66de0f1a06 135 {
AzureIoTClient 20:ea66de0f1a06 136 memcpy(temp, buffer, size);
AzureIoTClient 20:ea66de0f1a06 137 temp[size] = '\0';
AzureIoTClient 20:ea66de0f1a06 138 EXECUTE_COMMAND_RESULT executeCommandResult = EXECUTE_COMMAND(userContextCallback, temp);
AzureIoTClient 20:ea66de0f1a06 139 result =
AzureIoTClient 20:ea66de0f1a06 140 (executeCommandResult == EXECUTE_COMMAND_ERROR) ? IOTHUBMESSAGE_ABANDONED :
AzureIoTClient 20:ea66de0f1a06 141 (executeCommandResult == EXECUTE_COMMAND_SUCCESS) ? IOTHUBMESSAGE_ACCEPTED :
AzureIoTClient 20:ea66de0f1a06 142 IOTHUBMESSAGE_REJECTED;
AzureIoTClient 20:ea66de0f1a06 143 free(temp);
AzureIoTClient 20:ea66de0f1a06 144 }
AzureIoTClient 20:ea66de0f1a06 145 }
AzureIoTClient 20:ea66de0f1a06 146 return result;
AzureIoTClient 20:ea66de0f1a06 147 }
AzureIoTClient 20:ea66de0f1a06 148
AzureIoTClient 20:ea66de0f1a06 149 void remote_monitoring_run(void)
AzureIoTClient 20:ea66de0f1a06 150 {
AzureIoTClient 20:ea66de0f1a06 151 if (serializer_init(NULL) != SERIALIZER_OK)
AzureIoTClient 20:ea66de0f1a06 152 {
AzureIoTClient 20:ea66de0f1a06 153 printf("Failed on serializer_init\r\n");
AzureIoTClient 20:ea66de0f1a06 154 }
AzureIoTClient 20:ea66de0f1a06 155 else
AzureIoTClient 20:ea66de0f1a06 156 {
AzureIoTClient 20:ea66de0f1a06 157 IOTHUB_CLIENT_CONFIG config;
AzureIoTClient 20:ea66de0f1a06 158
AzureIoTClient 20:ea66de0f1a06 159 config.deviceId = deviceId;
AzureIoTClient 20:ea66de0f1a06 160 config.deviceKey = deviceKey;
AzureIoTClient 20:ea66de0f1a06 161 config.iotHubName = hubName;
AzureIoTClient 20:ea66de0f1a06 162 config.iotHubSuffix = hubSuffix;
AzureIoTClient 20:ea66de0f1a06 163 config.protocol = AMQP_Protocol;
AzureIoTClient 20:ea66de0f1a06 164
AzureIoTClient 20:ea66de0f1a06 165 IOTHUB_CLIENT_HANDLE iotHubClientHandle = IoTHubClient_Create(&config);
AzureIoTClient 20:ea66de0f1a06 166 if (iotHubClientHandle == NULL)
AzureIoTClient 20:ea66de0f1a06 167 {
AzureIoTClient 20:ea66de0f1a06 168 (void)printf("Failed on IoTHubClient_CreateFromConnectionString\r\n");
AzureIoTClient 20:ea66de0f1a06 169 }
AzureIoTClient 20:ea66de0f1a06 170 else
AzureIoTClient 20:ea66de0f1a06 171 {
AzureIoTClient 20:ea66de0f1a06 172 #ifdef MBED_BUILD_TIMESTAMP
AzureIoTClient 20:ea66de0f1a06 173 // For mbed add the certificate information
AzureIoTClient 20:ea66de0f1a06 174 if (IoTHubClient_SetOption(iotHubClientHandle, "TrustedCerts", certificates) != IOTHUB_CLIENT_OK)
AzureIoTClient 20:ea66de0f1a06 175 {
AzureIoTClient 20:ea66de0f1a06 176 printf("failure to set option \"TrustedCerts\"\r\n");
AzureIoTClient 20:ea66de0f1a06 177 }
AzureIoTClient 20:ea66de0f1a06 178 #endif // MBED_BUILD_TIMESTAMP
AzureIoTClient 20:ea66de0f1a06 179
AzureIoTClient 20:ea66de0f1a06 180 Thermostat* thermostat = CREATE_MODEL_INSTANCE(Contoso, Thermostat);
AzureIoTClient 20:ea66de0f1a06 181 if (thermostat == NULL)
AzureIoTClient 20:ea66de0f1a06 182 {
AzureIoTClient 20:ea66de0f1a06 183 (void)printf("Failed on CREATE_MODEL_INSTANCE\r\n");
AzureIoTClient 20:ea66de0f1a06 184 }
AzureIoTClient 20:ea66de0f1a06 185 else
AzureIoTClient 20:ea66de0f1a06 186 {
AzureIoTClient 20:ea66de0f1a06 187 STRING_HANDLE commandsMetadata;
AzureIoTClient 20:ea66de0f1a06 188
AzureIoTClient 20:ea66de0f1a06 189 if (IoTHubClient_SetMessageCallback(iotHubClientHandle, IoTHubMessage, thermostat) != IOTHUB_CLIENT_OK)
AzureIoTClient 20:ea66de0f1a06 190 {
AzureIoTClient 20:ea66de0f1a06 191 printf("unable to IoTHubClient_SetMessageCallback\r\n");
AzureIoTClient 20:ea66de0f1a06 192 }
AzureIoTClient 20:ea66de0f1a06 193 else
AzureIoTClient 20:ea66de0f1a06 194 {
AzureIoTClient 20:ea66de0f1a06 195
AzureIoTClient 20:ea66de0f1a06 196 /* send the device info upon startup so that the cloud app knows
AzureIoTClient 20:ea66de0f1a06 197 what commands are available and the fact that the device is up */
AzureIoTClient 20:ea66de0f1a06 198 thermostat->ObjectType = "DeviceInfo";
AzureIoTClient 20:ea66de0f1a06 199 thermostat->IsSimulatedDevice = false;
AzureIoTClient 20:ea66de0f1a06 200 thermostat->Version = "1.0";
AzureIoTClient 20:ea66de0f1a06 201 thermostat->DeviceProperties.HubEnabledState = true;
AzureIoTClient 20:ea66de0f1a06 202 thermostat->DeviceProperties.DeviceID = (char*)deviceId;
AzureIoTClient 20:ea66de0f1a06 203
AzureIoTClient 20:ea66de0f1a06 204 commandsMetadata = STRING_new();
AzureIoTClient 20:ea66de0f1a06 205 if (commandsMetadata == NULL)
AzureIoTClient 20:ea66de0f1a06 206 {
AzureIoTClient 20:ea66de0f1a06 207 (void)printf("Failed on creating string for commands metadata\r\n");
AzureIoTClient 20:ea66de0f1a06 208 }
AzureIoTClient 20:ea66de0f1a06 209 else
AzureIoTClient 20:ea66de0f1a06 210 {
AzureIoTClient 20:ea66de0f1a06 211 /* Serialize the commands metadata as a JSON string before sending */
AzureIoTClient 20:ea66de0f1a06 212 if (SchemaSerializer_SerializeCommandMetadata(GET_MODEL_HANDLE(Contoso, Thermostat), commandsMetadata) != SCHEMA_SERIALIZER_OK)
AzureIoTClient 20:ea66de0f1a06 213 {
AzureIoTClient 20:ea66de0f1a06 214 (void)printf("Failed serializing commands metadata\r\n");
AzureIoTClient 20:ea66de0f1a06 215 }
AzureIoTClient 20:ea66de0f1a06 216 else
AzureIoTClient 20:ea66de0f1a06 217 {
AzureIoTClient 20:ea66de0f1a06 218 unsigned char* buffer;
AzureIoTClient 20:ea66de0f1a06 219 size_t bufferSize;
AzureIoTClient 20:ea66de0f1a06 220 thermostat->Commands = (char*)STRING_c_str(commandsMetadata);
AzureIoTClient 20:ea66de0f1a06 221
AzureIoTClient 20:ea66de0f1a06 222 /* Here is the actual send of the Device Info */
AzureIoTClient 20:ea66de0f1a06 223 if (SERIALIZE(&buffer, &bufferSize, thermostat->ObjectType, thermostat->Version, thermostat->IsSimulatedDevice, thermostat->DeviceProperties, thermostat->Commands) != IOT_AGENT_OK)
AzureIoTClient 20:ea66de0f1a06 224 {
AzureIoTClient 20:ea66de0f1a06 225 (void)printf("Failed serializing\r\n");
AzureIoTClient 20:ea66de0f1a06 226 }
AzureIoTClient 20:ea66de0f1a06 227 else
AzureIoTClient 20:ea66de0f1a06 228 {
AzureIoTClient 20:ea66de0f1a06 229 sendMessage(iotHubClientHandle, buffer, bufferSize);
AzureIoTClient 20:ea66de0f1a06 230 }
AzureIoTClient 20:ea66de0f1a06 231
AzureIoTClient 20:ea66de0f1a06 232 }
AzureIoTClient 20:ea66de0f1a06 233
AzureIoTClient 20:ea66de0f1a06 234 STRING_delete(commandsMetadata);
AzureIoTClient 20:ea66de0f1a06 235 }
AzureIoTClient 20:ea66de0f1a06 236
AzureIoTClient 20:ea66de0f1a06 237 thermostat->Temperature = 50.0;
AzureIoTClient 20:ea66de0f1a06 238 thermostat->ExternalTemperature = 55.0;
AzureIoTClient 20:ea66de0f1a06 239 thermostat->Humidity = 50.0;
AzureIoTClient 20:ea66de0f1a06 240 thermostat->DeviceId = (char*)deviceId;
AzureIoTClient 20:ea66de0f1a06 241
ppatierno 23:e37e4e321690 242 SHT15_init();
ppatierno 23:e37e4e321690 243
AzureIoTClient 20:ea66de0f1a06 244 while (1)
AzureIoTClient 20:ea66de0f1a06 245 {
AzureIoTClient 20:ea66de0f1a06 246 unsigned char*buffer;
AzureIoTClient 20:ea66de0f1a06 247 size_t bufferSize;
ppatierno 23:e37e4e321690 248
ppatierno 23:e37e4e321690 249 SHT15_update();
ppatierno 23:e37e4e321690 250
ppatierno 23:e37e4e321690 251 thermostat->Temperature = SHT15_getTemperature();
ppatierno 23:e37e4e321690 252 thermostat->ExternalTemperature = SHT15_getTemperature();
ppatierno 23:e37e4e321690 253 thermostat->Humidity = SHT15_getHumidity();
AzureIoTClient 20:ea66de0f1a06 254
AzureIoTClient 20:ea66de0f1a06 255 (void)printf("Sending sensor value Temperature = %02f, Humidity = %02f\r\n", thermostat->Temperature, thermostat->Humidity);
AzureIoTClient 20:ea66de0f1a06 256
AzureIoTClient 22:afe08a0ed332 257 if (SERIALIZE(&buffer, &bufferSize, thermostat->DeviceId, thermostat->Temperature, thermostat->Humidity, thermostat->ExternalTemperature) != IOT_AGENT_OK)
AzureIoTClient 20:ea66de0f1a06 258 {
AzureIoTClient 20:ea66de0f1a06 259 (void)printf("Failed sending sensor value\r\n");
AzureIoTClient 20:ea66de0f1a06 260 }
AzureIoTClient 20:ea66de0f1a06 261 else
AzureIoTClient 20:ea66de0f1a06 262 {
AzureIoTClient 20:ea66de0f1a06 263 sendMessage(iotHubClientHandle, buffer, bufferSize);
AzureIoTClient 20:ea66de0f1a06 264 }
AzureIoTClient 20:ea66de0f1a06 265
AzureIoTClient 20:ea66de0f1a06 266 ThreadAPI_Sleep(1000);
AzureIoTClient 20:ea66de0f1a06 267 }
AzureIoTClient 20:ea66de0f1a06 268 }
AzureIoTClient 20:ea66de0f1a06 269
AzureIoTClient 20:ea66de0f1a06 270 DESTROY_MODEL_INSTANCE(thermostat);
AzureIoTClient 20:ea66de0f1a06 271 }
AzureIoTClient 20:ea66de0f1a06 272 IoTHubClient_Destroy(iotHubClientHandle);
AzureIoTClient 20:ea66de0f1a06 273 }
AzureIoTClient 20:ea66de0f1a06 274 serializer_deinit();
AzureIoTClient 20:ea66de0f1a06 275 }
AzureIoTClient 20:ea66de0f1a06 276 }