![]() |
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 device EUI |
len | the length of device EUI(must be 8 bytes) |
TRUE | for getting device EUI successfully |
FALSE | for getting device EUI failure |
// OTAA Device EUI MSB uint8_t node_device_eui[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; void setup() { Serial.begin(115200); api.lorawan.njm.set(RAK_LORA_OTAA); // Set LoRaWan join mode to OTAA if(api.lorawan.deui.set(node_device_eui, 8) == true) Serial.println("LoRaWan device EUI set success"); else Serial.println("LoRaWan device EUI set fail"); } void loop() { uint8_t buff[8]; if(api.lorawan.deui.get(buff, 8) == true) { Serial.print("LoRaWan device EUI = 0x"); for(int i = 0; i < 8; i++) { Serial.printf("%02X", buff[i]); } Serial.println(""); } else { Serial.println("LoRaWan device EUI get fail"); } delay(1000); }
bool set | ( | uint8_t * | buf, |
uint32_t | len | ||
) |
buf | the buffer to set device EUI |
len | the length of device EUI(must be 8 bytes) |
TRUE | for setting device EUI successfully |
FALSE | for setting device EUI failure |
// OTAA Device EUI MSB uint8_t node_device_eui[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; void setup() { Serial.begin(115200); api.lorawan.njm.set(RAK_LORA_OTAA); // Set LoRaWan join mode to OTAA if(api.lorawan.deui.set(node_device_eui, 8) == true) Serial.println("LoRaWan device EUI set success"); else Serial.println("LoRaWan device EUI set fail"); } void loop() { uint8_t buff[8]; if(api.lorawan.deui.get(buff, 8) == true) { Serial.print("LoRaWan device EUI = 0x"); for(int i = 0; i < 8; i++) { Serial.printf("%02X", buff[i]); } Serial.println(""); } else { Serial.println("LoRaWan device EUI get fail"); } delay(1000); }