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

Public Member Functions

uint8_t get ()
 
bool set (uint8_t value)
 

Detailed Description

Description
This api provides the configuration code rate for the P2P mode

Member Function Documentation

◆ get()

uint8_t get ( )
Description
This api allows to get code rate for the P2P mode Note:This API will be deleted in the future
Syntax
api.lorawan.pcr.get()
Returns
The code rate
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 code rate %s\r\n", api.lorawan.pcr.set(0) ? "Success" : "Fail");
}

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

    delay(1000);
}

◆ set()

bool set ( uint8_t  value)
Description
This api allows to set code rate for the P2P mode Note:This API will be deleted in the future
Syntax
api.lorawan.pcr.set(value)
Parameters
valuethe code rate for P2P mode
Returns
bool
Return values
TRUEfor setting code rate success
FALSEfor setting code rate 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 code rate %s\r\n", api.lorawan.pcr.set(0) ? "Success" : "Fail");
  }

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

      delay(1000);
  }