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

Public Member Functions

uint32_t get ()
 
bool set (uint32_t value)
 

Detailed Description

Description
This api provides configuration frequency for the P2P mode

Member Function Documentation

◆ get()

uint32_t get ( )
Description
This api allows to get the P2P frequency Note:This API will be deleted in the future
Syntax
api.lorawan.pfreq.get()
Returns
The frequency for P2P mode
Example
void setup()
{
    Serial.begin(115200);

    Serial.printf("Set Node device work mode %s\r\n", api.lorawan.nwm.set(0) ? "Success" : "Fail");   
    Serial.printf("Set P2P mode frequency %s\r\n", api.lorawan.pfreq.set(868000000) ? "Success" : "Fail");   
}

void loop()
{
    Serial.printf("P2P mode frequency = %d\r\n", api.lorawan.pfreq.get());

    delay(1000);
}

◆ set()

bool set ( uint32_t  value)
Description
This api allows to set the P2P frequency Note:This API will be deleted in the future
Syntax
api.lorawan.pfreq.set(value)
Parameters
valuethe frequency for P2P mode
Returns
bool
Return values
TRUEfor setting frequency success
FALSEfor setting frequency failure
Example
  void setup()
  {
      Serial.begin(115200);

      Serial.printf("Set Node device work mode %s\r\n", api.lorawan.nwm.set(0) ? "Success" : "Fail");
      Serial.printf("Set P2P mode frequency %s\r\n", api.lorawan.pfreq.set(868000000) ? "Success" : "Fail");
  }

  void loop()
  {
      Serial.printf("P2P mode frequency = %d\r\n", api.lorawan.pfreq.get());

      delay(1000);
  }