Skip to content

Commit

Permalink
chore: Enable printDebugInfo() for LoRa devices
Browse files Browse the repository at this point in the history
  • Loading branch information
zfields committed Sep 10, 2024
1 parent 48c9bac commit 796d687
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/ArduinoIoTCloud-Advanced/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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
}

Expand Down
6 changes: 6 additions & 0 deletions examples/ArduinoIoTCloud-Basic/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}

Expand Down
7 changes: 7 additions & 0 deletions examples/ArduinoIoTCloud-Callbacks/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions examples/ArduinoIoTCloud-Schedule/thingProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 796d687

Please sign in to comment.