Azure IoT / serializer

Dependents:   sht15_remote_monitoring f767zi_mqtt remote_monitoring simplesample_amqp ... more

Embed: (wiki syntax)

« Back to documentation index

serializer.h File Reference

serializer.h File Reference

The IoT Hub Serializer APIs allows developers to define models for their devices. More...

Go to the source code of this file.


Detailed Description

The IoT Hub Serializer APIs allows developers to define models for their devices.

The IoT Hub Serializer APIs allows developers to quickly and easily define models for their devices directly as code, while supporting the required features for modeling devices (including multiple models and multiple devices within the same application). For example:

       BEGIN_NAMESPACE(Contoso);
           DECLARE_STRUCT(SystemProperties,
               ascii_char_ptr, DeviceID,
               _Bool, Enabled
           );
           DECLARE_MODEL(VendingMachine,
               WITH_DATA(int, SensorValue),
               WITH_DATA(ascii_char_ptr, ObjectName),
               WITH_DATA(ascii_char_ptr, ObjectType),
               WITH_DATA(ascii_char_ptr, Version),
               WITH_DATA(SystemProperties, SystemProperties),
               WITH_DATA(ascii_char_ptr_no_quotes, Commands),
               WITH_ACTION(SetItemPrice, ascii_char_ptr, itemId, ascii_char_ptr, price)
           );
       END_NAMESPACE(Contoso);
       

Definition in file serializer.h.