RUI3 (RAK Unified Interface 3) - RAK4631
RAKLorawan::nwm

Public Member Functions

int get ()
 
bool set (uint8_t value)
 

Detailed Description

Description
Switch to point-to-point mode, or LoRaWAN mode, or FSK mode [0:Point to point, 1:LoRaWAN, 2:FSK]

Member Function Documentation

◆ get()

int get ( )
Description
This api allows to get the network working mode (0 = P2P, 1 = LoRaWAN, 2 = FSK)
Syntax
api.lorawan.nwm.get()
Returns
the netwok working mode
Return values
0P2P mode
1LoRaWan mode
2FSK mode
Example
  void setup()
  {
      Serial.begin(115200);

      Serial.printf("Set the network working mode %s\r\n", api.lorawan.nwm.set(1) ? "Success" : "Fail");
  }

  void loop()
  {
      Serial.printf("Network working mode = %s\r\n", api.lorawan.nwm.get() ? "LoRaWan" : "P2P");

      delay(1000);
  }

◆ set()

bool set ( uint8_t  value)
Description
This api allows to set the network working mode (0 = P2P, 1 = LoRaWAN, 2 = FSK)
Syntax
api.lorawan.nwm.set(value)
Parameters
valuethe network working mode
Returns
bool
Return values
TRUEfor setting network working mode success
FALSEfor setting network working mode failure
Example
  void setup()
  {
      Serial.begin(115200);

      Serial.printf("Set the network working mode %s\r\n", api.lorawan.nwm.set(1) ? "Success" : "Fail");
  }

  void loop()
  {
      Serial.printf("Network working mode = %s\r\n", api.lorawan.nwm.get() ? "LoRaWan" : "P2P");

      delay(1000);
  }