Skip to content

Commit 7449f46

Browse files
committed
added bang commands for app eui, dev eui, status and op class
1 parent c90372f commit 7449f46

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

sfeIoTNodeLoRaWAN/sfeNLCommands.h

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ class sfeNLCommands
383383
flxLog_I("Device ID: %s", flux.deviceId());
384384

385385
return true;
386-
} //---------------------------------------------------------------------
386+
}
387+
//---------------------------------------------------------------------
387388
///
388389
/// @brief Toggle verbose output
389390
///
@@ -399,6 +400,75 @@ class sfeNLCommands
399400

400401
return true;
401402
}
403+
//---------------------------------------------------------------------
404+
///
405+
/// @brief output lora device EUI
406+
///
407+
/// @param theApp Pointer to the DataLogger App
408+
/// @retval bool indicates success (true) or failure (!true)
409+
///
410+
bool loraDeviceEUI(sfeIoTNodeLoRaWAN *theApp)
411+
{
412+
413+
if (!theApp)
414+
return false;
415+
416+
flxLog_I("Device EUI: %s", theApp->_loraWANConnection.deviceEUI());
417+
418+
return true;
419+
}
420+
//---------------------------------------------------------------------
421+
///
422+
/// @brief output lora application EUI
423+
///
424+
/// @param theApp Pointer to the DataLogger App
425+
/// @retval bool indicates success (true) or failure (!true)
426+
///
427+
bool loraApplicationEUI(sfeIoTNodeLoRaWAN *theApp)
428+
{
429+
430+
if (!theApp)
431+
return false;
432+
433+
flxLog_I("Application EUI: %s", theApp->_loraWANConnection.appEUI().c_str());
434+
435+
return true;
436+
}
437+
//---------------------------------------------------------------------
438+
///
439+
/// @brief output lora op class
440+
///
441+
/// @param theApp Pointer to the DataLogger App
442+
/// @retval bool indicates success (true) or failure (!true)
443+
///
444+
bool loraOpClass(sfeIoTNodeLoRaWAN *theApp)
445+
{
446+
447+
if (!theApp)
448+
return false;
449+
450+
flxLog_I("Operating Class: '%s'",
451+
theApp->_loraWANConnection.kLoRaWANClasses[theApp->_loraWANConnection.loraWANClass()]);
452+
453+
return true;
454+
}
455+
//---------------------------------------------------------------------
456+
///
457+
/// @brief output lora connection status
458+
///
459+
/// @param theApp Pointer to the DataLogger App
460+
/// @retval bool indicates success (true) or failure (!true)
461+
///
462+
bool loraStatus(sfeIoTNodeLoRaWAN *theApp)
463+
{
464+
465+
if (!theApp)
466+
return false;
467+
468+
flxLog_I("LoRaWAN Status: '%s'", theApp->_loraWANConnection.isConnected() ? "Connected" : "Disconnected");
469+
470+
return true;
471+
}
402472

403473
//---------------------------------------------------------------------
404474
// our command map - command name to callback method
@@ -420,6 +490,10 @@ class sfeNLCommands
420490
{"systime", &sfeNLCommands::outputSystemTime},
421491
{"uptime", &sfeNLCommands::outputUpTime},
422492
{"verbose", &sfeNLCommands::toggleVerboseOutput},
493+
{"lora-device-eui", &sfeNLCommands::loraDeviceEUI},
494+
{"lora-app-eui", &sfeNLCommands::loraApplicationEUI},
495+
{"lora-op-class", &sfeNLCommands::loraOpClass},
496+
{"lora-status", &sfeNLCommands::loraStatus},
423497
{"device-id", &sfeNLCommands::printDeviceID},
424498
{"version", &sfeNLCommands::printVersion},
425499
{"about", &sfeNLCommands::aboutDevice},

0 commit comments

Comments
 (0)