![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Public Member Functions | |
bool | get (uint8_t *buf, uint32_t len) |
bool | set (uint8_t *buf, uint32_t len) |
bool get | ( | uint8_t * | buf, |
uint32_t | len | ||
) |
buf | the buffer to get AppEUI |
len | the length of AppEUI(must be 8 bytes) |
TRUE | for getting AppEUI successfully |
FALSE | for getting AppEUI failure |
// OTAA Application EUI MSB uint8_t node_app_eui[8] = {0x0E, 0x0D, 0x0D, 0x01, 0x0E, 0x01, 0x02, 0x03}; void setup() { Serial.begin(115200); api.lorawan.njm.set(RAK_LORA_OTAA); // Set LoRaWan join mode to OTAA if(api.lorawan.appeui.set(node_app_eui, 8) == true) Serial.println("LoRaWan AppEUI set success"); else Serial.println("LoRaWan AppEUI set fail"); } void loop() { uint8_t buff[8]; if(api.lorawan.appeui.get(buff, 8) == true) { Serial.print("LoRaWan AppEUI = 0x"); for(int i = 0; i < 8; i++) { Serial.printf("%02X", buff[i]); } Serial.println(""); } else { Serial.println("LoRaWan APPEUI get fail"); } delay(1000); }
bool set | ( | uint8_t * | buf, |
uint32_t | len | ||
) |
buf | the buffer to set AppEUI |
len | the length of AppEUI(must be 8 bytes) |
TRUE | for setting AppEUI successfully |
FALSE | for setting AppEUI failure |
// OTAA Application EUI MSB uint8_t node_app_eui[8] = {0x0E, 0x0D, 0x0D, 0x01, 0x0E, 0x01, 0x02, 0x03}; void setup() { Serial.begin(115200); api.lorawan.njm.set(RAK_LORA_OTAA); // Set LoRaWan join mode to OTAA if(api.lorawan.appeui.set(node_app_eui, 8) == true) Serial.println("LoRaWan AppEUI set success"); else Serial.println("LoRaWan AppEUI set fail"); } void loop() { uint8_t buff[8]; if(api.lorawan.appeui.get(buff, 8) == true) { Serial.print("LoRaWan AppEUI = 0x"); for(int i = 0; i < 8; i++) { Serial.printf("%02X", buff[i]); } Serial.println(""); } else { Serial.println("LoRaWan AppEUI get fail"); } delay(1000); }