From 796d68788607da383dc1160341e1d4d0c7e0148a Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Fri, 23 Aug 2024 01:42:37 -0500 Subject: [PATCH] chore: Enable `printDebugInfo()` for LoRa devices --- examples/ArduinoIoTCloud-Advanced/thingProperties.h | 6 ++++++ examples/ArduinoIoTCloud-Basic/thingProperties.h | 6 ++++++ examples/ArduinoIoTCloud-Callbacks/thingProperties.h | 7 +++++++ examples/ArduinoIoTCloud-Schedule/thingProperties.h | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/examples/ArduinoIoTCloud-Advanced/thingProperties.h b/examples/ArduinoIoTCloud-Advanced/thingProperties.h index 6e1e6656..64040550 100644 --- a/examples/ArduinoIoTCloud-Advanced/thingProperties.h +++ b/examples/ArduinoIoTCloud-Advanced/thingProperties.h @@ -10,6 +10,10 @@ #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" #endif +#if defined(HAS_LORA) + #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +#endif + void onSwitchButtonChange(); void onColorChange(); @@ -30,6 +34,8 @@ void initProperties() { ArduinoCloud.addProperty(switchButton, 1, Permission::Write).onUpdate(onSwitchButtonChange); ArduinoCloud.addProperty(location, 2, Permission::Read).publishOnChange(0.0f); ArduinoCloud.addProperty(color, 3, Permission::ReadWrite).onUpdate(onColorChange); + + ArduinoCloud.setThingId(THING_ID); #endif } diff --git a/examples/ArduinoIoTCloud-Basic/thingProperties.h b/examples/ArduinoIoTCloud-Basic/thingProperties.h index 48be1bf9..a354b38f 100644 --- a/examples/ArduinoIoTCloud-Basic/thingProperties.h +++ b/examples/ArduinoIoTCloud-Basic/thingProperties.h @@ -10,6 +10,10 @@ #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" #endif +#if defined(HAS_LORA) + #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +#endif + void onLedChange(); bool led; @@ -29,6 +33,8 @@ void initProperties() { ArduinoCloud.addProperty(led, 1, Permission::ReadWrite).onUpdate(onLedChange); ArduinoCloud.addProperty(potentiometer, 2, Permission::Read).publishOnChange(10); ArduinoCloud.addProperty(seconds, 3, Permission::Read).publishEvery(5 * MINUTES); + + ArduinoCloud.setThingId(THING_ID); #endif } diff --git a/examples/ArduinoIoTCloud-Callbacks/thingProperties.h b/examples/ArduinoIoTCloud-Callbacks/thingProperties.h index d52660a9..69f0ea0b 100644 --- a/examples/ArduinoIoTCloud-Callbacks/thingProperties.h +++ b/examples/ArduinoIoTCloud-Callbacks/thingProperties.h @@ -10,11 +10,18 @@ #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" #endif +#if defined(BOARD_HAS_LORA) + #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +#endif + void initProperties() { #if defined(BOARD_HAS_SECRET_KEY) ArduinoCloud.setBoardId(BOARD_ID); ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY); #endif +#if defined(BOARD_HAS_LORA) + ArduinoCloud.setThingId(THING_ID); +#endif } #if defined(BOARD_HAS_WIFI) diff --git a/examples/ArduinoIoTCloud-Schedule/thingProperties.h b/examples/ArduinoIoTCloud-Schedule/thingProperties.h index 8a3d21f9..d9958c6d 100644 --- a/examples/ArduinoIoTCloud-Schedule/thingProperties.h +++ b/examples/ArduinoIoTCloud-Schedule/thingProperties.h @@ -10,6 +10,10 @@ #define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" #endif +#if defined(HAS_LORA) + #define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +#endif + void onSwitchButtonChange(); bool switchButton; @@ -37,6 +41,8 @@ void initProperties() { ArduinoCloud.addProperty(yearly, Permission::ReadWrite); #elif defined(HAS_LORA) ArduinoCloud.addProperty(switchButton, 1, Permission::Write); + + ArduinoCloud.setThingId(THING_ID); #endif }