File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
ArduinoIoTCloud-Callbacks Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1010 #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1111#endif
1212
13+ #if defined(HAS_LORA )
14+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15+ #endif
16+
1317void onSwitchButtonChange ();
1418void onColorChange ();
1519
@@ -30,6 +34,8 @@ void initProperties() {
3034 ArduinoCloud .addProperty (switchButton , 1 , Permission ::Write ).onUpdate (onSwitchButtonChange );
3135 ArduinoCloud .addProperty (location , 2 , Permission ::Read ).publishOnChange (0.0f );
3236 ArduinoCloud .addProperty (color , 3 , Permission ::ReadWrite ).onUpdate (onColorChange );
37+
38+ ArduinoCloud .setThingId (THING_ID );
3339#endif
3440}
3541
Original file line number Diff line number Diff line change 1010 #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1111#endif
1212
13+ #if defined(HAS_LORA )
14+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15+ #endif
16+
1317void onLedChange ();
1418
1519bool led ;
@@ -29,6 +33,8 @@ void initProperties() {
2933 ArduinoCloud .addProperty (led , 1 , Permission ::ReadWrite ).onUpdate (onLedChange );
3034 ArduinoCloud .addProperty (potentiometer , 2 , Permission ::Read ).publishOnChange (10 );
3135 ArduinoCloud .addProperty (seconds , 3 , Permission ::Read ).publishEvery (5 * MINUTES );
36+
37+ ArduinoCloud .setThingId (THING_ID );
3238#endif
3339}
3440
Original file line number Diff line number Diff line change 1010 #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1111#endif
1212
13+ #if defined(BOARD_HAS_LORA )
14+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15+ #endif
16+
1317void initProperties () {
1418#if defined(BOARD_HAS_SECRET_KEY )
1519 ArduinoCloud .setBoardId (BOARD_ID );
1620 ArduinoCloud .setSecretDeviceKey (SECRET_DEVICE_KEY );
1721#endif
22+ #if defined(BOARD_HAS_LORA )
23+ ArduinoCloud .setThingId (THING_ID );
24+ #endif
1825}
1926
2027#if defined(BOARD_HAS_WIFI )
Original file line number Diff line number Diff line change 1010 #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1111#endif
1212
13+ #if defined(HAS_LORA )
14+ #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
15+ #endif
16+
1317void onSwitchButtonChange ();
1418
1519bool switchButton ;
@@ -37,6 +41,8 @@ void initProperties() {
3741 ArduinoCloud .addProperty (yearly , Permission ::ReadWrite );
3842#elif defined(HAS_LORA )
3943 ArduinoCloud .addProperty (switchButton , 1 , Permission ::Write );
44+
45+ ArduinoCloud .setThingId (THING_ID );
4046#endif
4147}
4248
You can’t perform that action at this time.
0 commit comments