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

Public Member Functions

uint8_t get ()
 
bool set (uint8_t value)
 

Detailed Description

Description
This api provides configuration Power for the P2P mode

Member Function Documentation

◆ get()

uint8_t get ( )
Description
This api allows to get P2P TX Power(5-22) Note:This API will be deleted in the future
Syntax
api.lorawan.ptp.get()
Returns
The Tx power 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 tx power %s\r\n", api.lorawan.ptp.set(22) ? "Success" : "Fail");
}

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

    delay(1000);
}

◆ set()

bool set ( uint8_t  value)
Description
This api allows to set P2P TX Power(5-22) Note:This API will be deleted in the future
Syntax
api.lorawan.ptp.set(value)
Parameters
valuethe P2P Tx power
Returns
bool
Return values
TRUEfor setting P2P Tx power success
FALSEfor setting P2P Tx power 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 tx power %s\r\n", api.lorawan.ptp.set(22) ? "Success" : "Fail");
  }

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

      delay(1000);
  }