From 18c1e0126f8cddbc7ce919e31de44d4a01f2b72a Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Mon, 13 Jun 2022 01:05:26 -0400 Subject: [PATCH] Fix #323: adapt catena_hello_lora --- .../catena_hello_lora/catena_hello_lora.ino | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/examples/catena_hello_lora/catena_hello_lora.ino b/examples/catena_hello_lora/catena_hello_lora.ino index a493863..f872243 100644 --- a/examples/catena_hello_lora/catena_hello_lora.ino +++ b/examples/catena_hello_lora/catena_hello_lora.ino @@ -14,16 +14,17 @@ Author: */ #include +#include #include using namespace McciCatena; // declare the global object for the platform. -Catena gCatena; -Catena::LoRaWAN gLoRaWAN; - -// declare the LED object -StatusLed gLed (Catena::PIN_STATUS_LED); +Catena gCatena( + Version_t{CATENA_ARDUINO_PLATFORM_VERSION}, + __FILE__, + "Simple hello-world sketc with LoRaWAN" + ); // declare the callback function. Arduino_LoRaWAN::SendBufferCbFn uplinkDone; @@ -36,20 +37,14 @@ uint8_t uplinkBuffer[] = { 0xCA, 0xFE, 0xBA, 0xBE }; void setup() { - gCatena.begin(); + gCatena.usingLoRaWAN(); + gCatena.setup(); gCatena.SafePrintf("Hello, world (with LoRa)!\n"); gCatena.SafePrintf("This is a basic demo program for the MCCI Catena-Arduino-Platform library.\n"); - gCatena.SafePrintf("Enter 'help' for a list of commands.\n"); - gCatena.SafePrintf("(remember to select 'Line Ending: Newline' at the bottom of the monitor window.)\n"); - gLed.begin(); - gCatena.registerObject(&gLed); gLed.Set(LedPattern::FastFlash); - gLoRaWAN.begin(&gCatena); - gCatena.registerObject(&gLoRaWAN); - if (! gLoRaWAN.IsProvisioned()) gCatena.SafePrintf("LoRaWAN not provisioned yet. Use the commands to set it up.\n"); else