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

Public Member Functions

bool get (uint16_t *buff)
 
bool set (uint16_t *value)
 

Detailed Description

Description
This api configures the channel of the device by setting the hexadecimal channel mask

Member Function Documentation

◆ get()

bool get ( uint16_t *  buff)
Description
This api allows the user to set the channel mask, close or open the channel
Syntax
api.lorawan.mask.get(buff)
Parameters
buffthe buffer to store channel mask
Returns
bool
Return values
TRUEfot getting channel mask success
FALSEfor setting channel mask failure
Example
  uint16_t maskBuff = 0x0003;
  
  void setup()
  {
      Serial.begin(115200);

      api.lorawan.band.set(5);
      Serial.printf("Set channel mask %s\r\n", api.lorawan.mask.set(&maskBuff) ? "Success" : "Fail");

  }

  void loop()
  {
      
      Serial.printf("Get channel mask %s\r\n", api.lorawan.mask.get(&maskBuff) ? "Success" : "Fail");
      Serial.printf("Channel mask = %04X\r\n", maskBuff);
      delay(1000);
  }

◆ set()

bool set ( uint16_t *  value)
Description
This api allows the user to get the channel mask, close or open the channel
Syntax
api.lorawan.mask.set(value)
Parameters
valuethe buffer to set the channel mask
Returns
bool
Return values
TRUEfor setting channel mask success
FALSEfor setting channel mask failure
Example
  uint16_t maskBuff = 0x0003;

  void setup()
  {
      Serial.begin(115200);

      api.lorawan.band.set(5);
      Serial.printf("Set channel mask %s\r\n", api.lorawan.mask.set(&maskBuff) ? "Success" : "Fail");

  }

  void loop()
  {

      Serial.printf("Get channel mask %s\r\n", api.lorawan.mask.get(&maskBuff) ? "Success" : "Fail");
      Serial.printf("Channel mask = %04X\r\n", maskBuff);
      delay(1000);
  }