Skip to content
This repository was archived by the owner on Jul 22, 2022. It is now read-only.
This repository was archived by the owner on Jul 22, 2022. It is now read-only.

device twin for azure-iot-arduino  #62

Closed
@MehranMazhar

Description

@MehranMazhar

i need to use device twin in azure-iot-ardunio simplesample_mqtt example .but when i use this line of codes : (devicetwin_simplesample in azure-iot-c-sdk )

DECLARE_STRUCT(Maker,
ascii_char_ptr, makerName, /*Fabrikam, Contoso ... */
ascii_char_ptr, style, /sedan, minivan .../
int, year
);

DECLARE_STRUCT(Geo,
double, longitude,
double, latitude
);

DECLARE_MODEL(CarState,
WITH_REPORTED_PROPERTY(int32_t, softwareVersion),
WITH_REPORTED_PROPERTY(uint8_t, reported_maxSpeed),
WITH_REPORTED_PROPERTY(ascii_char_ptr, vanityPlate)
);

DECLARE_MODEL(CarSettings,
WITH_DESIRED_PROPERTY(uint8_t, desired_maxSpeed, onDesiredMaxSpeed),
WITH_DESIRED_PROPERTY(Geo, location)
);

DECLARE_DEVICETWIN_MODEL(Car,
WITH_REPORTED_PROPERTY(ascii_char_ptr, lastOilChangeDate), /this is a simple reported property/
WITH_DESIRED_PROPERTY(ascii_char_ptr, changeOilReminder),

WITH_REPORTED_PROPERTY(Maker, maker), /*this is a structured reported property*/
WITH_REPORTED_PROPERTY(CarState, state), /*this is a model in model*/
WITH_DESIRED_PROPERTY(CarSettings, settings) /*this is a model in model*/

);

Arduino: 1.8.3 (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)"
Build options changed, rebuilding all
In file included from C:\Users\mehran-pc\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:9:0,
from sketch\simplesample_mqtt.c:15:
C:\Users\mehran-pc\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:226:67: error: expected ')' before '(' token
#define WITH_REPORTED_PROPERTY(type, name) MODEL_REPORTED_PROPERTY(type, name)
sketch\simplesample_mqtt.c:63:5: note: in expansion of macro 'WITH_REPORTED_PROPERTY'

WITH_REPORTED_PROPERTY(ascii_char_ptr, lastOilChangeDate), /this is a simple reported property/

exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions