Skip to content

Commit

Permalink
Fix #323: adapt catena_lora_adr_rejoin example
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Jun 13, 2022
1 parent 1c4cabe commit 4c7785a
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions extra/test/catena_lora_adr_rejoin/catena_lora_adr_rejoin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ Author:
*/

#include <Catena.h>
#include <Catena_AppObjects.h>
#include <Catena_Led.h>
#include <arduino_lmic.h>

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__,
"Link ADR / rejoin test sketch"
);

// declare the callback function.
Arduino_LoRaWAN::SendBufferCbFn uplinkDone;
Expand All @@ -39,19 +40,13 @@ uint32_t nSent = 0;

void setup()
{
gCatena.begin();
gCatena.setup();
gCatena.usingLoRaWAN();

gCatena.SafePrintf("This is the ADR re-join test 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");
Expand Down

0 comments on commit 4c7785a

Please sign in to comment.