18#define NO_RESPONSE 255
21#define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array[0])))
71#define MAX_CMD_LEN (32)
72#define MAX_ARGUMENT 25
80#define MYLOG(tag, ...) \
84 Serial.printf("[%s] ", tag); \
85 Serial.printf(__VA_ARGS__); \
86 Serial.printf("\n"); \
140 RUI3(Stream &serial1, Stream &serial = Serial);
543 bool initOTAA(String devEUI, String appEUI, String appKEY);
575 bool getDevEUI(
char *eui, uint16_t array_len);
607 bool getAppEUI(
char *eui, uint16_t array_len);
639 bool getAppKey(
char *key, uint16_t array_len);
665 bool initABP(String devADDR, String nwksKEY, String appsKEY);
720 bool getAppsKey(
char *key, uint16_t array_len);
752 bool getNwsKey(
char *key, uint16_t array_len);
878 bool sendData(
int port,
char *datahex);
1119 void recvRX(uint32_t timeout);
1129 void flushRX(uint32_t timeout = 5000);
1149 bool sleep(
int mode);
1265 bool byteArrayToAscii(
char *b_array,
char *a_array, uint16_t b_array_len, uint16_t a_array_len);
1299 bool asciiArrayToByte(
char *b_array,
char *a_array, uint16_t b_array_len, uint16_t a_array_len);
1311 String _devADDR =
"00112233";
1313 String _devEUI =
"60C5A8FFFE000001";
1315 String _appEUI =
"60C5A8FFFE000001";
1317 String _nwksKEY =
"60C5A8FFFE00000160C5A8FFFE000001";
1319 String _appKEY =
"60C5A8FFFE00000160C5A8FFFE000001";
1321 String _appsKEY =
"60C5A8FFFE00000160C5A8FFFE000001";
bool setRegion(int region)
Set the LoRaWAN Region See AT+BAND
Definition rui3_at.cpp:159
uint32_t getDevAddress(void)
Get the DevAddr See AT+DEVADDR
Definition rui3_at.cpp:606
bool initABP(String devADDR, String nwksKEY, String appsKEY)
Set credentials for ABP join mode Before using this command, you must call setJoinMode(1)
Definition rui3_at.cpp:552
bool getP2P(p2p_settings *p2p_settings)
Get current P2P settings See AT+P2P
Definition rui3_at.cpp:898
bool setP2PCAD(bool enable)
Enable or disable P2P Channel Activitity Detection See AT+CAD
Definition rui3_at.cpp:971
uint8_t getLPM(void)
Get Low power mode status See AT+LPM
Definition rui3_at.cpp:282
bool initOTAA(String devEUI, String appEUI, String appKEY)
Set LoRaWAN credentials for OTAA join mode Before using this command, you must call setJoinMode(0)
Definition rui3_at.cpp:438
bool asciiArrayToByte(char *b_array, char *a_array, uint16_t b_array_len, uint16_t a_array_len)
Convert a ASCII HEX string array into a byte array.
Definition rui3_at.cpp:1043
bool getAppEUI(char *eui, uint16_t array_len)
Get the App EUI See AT+APPEUI
Definition rui3_at.cpp:515
char ret[1024]
Char array with the last response from the WisDuo module.
Definition rui3_at.h:1302
bool setClass(int classMode)
Set the LoRaWAN device Class See AT+CLASS
Definition rui3_at.cpp:100
bool getP2PCAD(void)
Get CAD status (enabled/disabled)
Definition rui3_at.cpp:994
uint8_t getWorkingMode(void)
Get the Working Mode status See AT+NWM
Definition rui3_at.cpp:368
bool getDevEUI(char *eui, uint16_t array_len)
Get the DevEUI See AT+DEVEUI
Definition rui3_at.cpp:496
bool setConfirmed(int type)
Set package transmission mode In confirmed mode, the LNS will acknowledge the packet,...
Definition rui3_at.cpp:657
bool setDataRate(int rate)
Set the Data Rate See AT+DR
Definition rui3_at.cpp:62
bool setJoinMode(int mode)
Set network join mode OTAA or ABP See AT+NJM
Definition rui3_at.cpp:381
bool sleep(int mode)
Set the module in sleep mode. not required if low power mode is enabled) When the module is in sleep ...
Definition rui3_at.cpp:244
bool byteArrayToAscii(char *b_array, char *a_array, uint16_t b_array_len, uint16_t a_array_len)
Convert a byte array into a ASCII HEX string array.
Definition rui3_at.cpp:1029
bool recvResponse(uint32_t timeout=10000)
Get response to an AT command from the device The last response to an AT command is stored in **RUI...
Definition rui3_at.cpp:714
uint8_t getJoinMode(void)
Get the network join mode See AT+NJM
Definition rui3_at.cpp:410
bool sendData(int port, char *datahex)
Send data in LoRaWAN mode See AT+SEND
Definition rui3_at.cpp:697
bool setUARTConfig(int Baud)
Change RUI3 communication baud rate See AT+BAUD
Definition rui3_at.cpp:1007
bool getNwsKey(char *key, uint16_t array_len)
Get the NwsKey See AT+NWKSKEY
Definition rui3_at.cpp:639
bool getAppsKey(char *key, uint16_t array_len)
Get the AppsKey See AT+APPSKEY
Definition rui3_at.cpp:621
bool sendRawCommand(char *command)
Send a raw command to the RUI3 module. See RUI3 AT command manual
Definition rui3_at.cpp:1015
bool joinLoRaNetwork(int timeout=15)
Join the network See AT+JOIN
Definition rui3_at.cpp:423
bool setLPMLevel(int mode)
Set the LPM level See AT+LPMLVL
Definition rui3_at.cpp:299
void recvRX(uint32_t timeout)
Get RX packet after LoRaWAN TX or LoRa P2P receive command The last received RX packet is stored in...
Definition rui3_at.cpp:764
void flushRX(uint32_t timeout=5000)
Flush the RX buffer in case there is something left.
Definition rui3_at.cpp:847
bool sendP2PData(char *datahex)
Send a data packet over LoRa P2P See AT+PSEND
Definition rui3_at.cpp:955
uint8_t getLPMLevel(void)
Get the current LPM level See AT+LPMLVL
Definition rui3_at.cpp:319
void reset(void)
Reset the RUI3 module Communication with the module will be lost See ATZ
Definition rui3_at.cpp:336
uint8_t getClass(void)
Get the class See AT+CLASS
Definition rui3_at.cpp:131
bool initP2P(p2p_settings *p2p_settings)
Initialize LoRa P2P mode See AT+P2P
Definition rui3_at.cpp:882
uint8_t getRegion(void)
Get the Region See AT+BAND
Definition rui3_at.cpp:226
bool getJoinStatus(void)
Get the Join Status See AT+NJS
Definition rui3_at.cpp:38
bool getVersion(void)
Get the firmware version number of the module. See AT+VER
Definition rui3_at.cpp:32
stParam param
Definition rui3_at.h:1304
bool setLPM(int mode)
Enable/Disable Low power mode See AT+LPM
Definition rui3_at.cpp:263
bool setWorkingMode(int mode)
Set the device to LoRaWAN mode or LoRa P2P mode See AT+NWM When switching the device mode,...
Definition rui3_at.cpp:342
uint8_t getConfirmed(void)
Get the Confirmed/Unconfirmed packet status In confirmed mode, the LNS will acknowledge the packet,...
Definition rui3_at.cpp:684
uint8_t getDataRate(void)
Get the data rate See AT+DR
Definition rui3_at.cpp:82
bool getAppKey(char *key, uint16_t array_len)
Get the AppKey See AT+APPKEY
Definition rui3_at.cpp:534
String getChannelList(void)
Get the current channel list settings This feature works only in Regions US915, AU915 or CN470 Se...
Definition rui3_at.cpp:51
char command[1024]
Definition rui3_at.cpp:20
#define MAX_ARGUMENT
Definition rui3_at.h:72
struct _p2p_settings p2p_settings
uint16_t bw
Definition rui3_at.h:105
uint16_t cr
Definition rui3_at.h:106
uint16_t txp
Definition rui3_at.h:108
uint16_t ppl
Definition rui3_at.h:107
uint16_t sf
Definition rui3_at.h:104
uint32_t freq
Definition rui3_at.h:103
int argc
Definition rui3_at.h:97
char * argv[MAX_ARGUMENT]
Definition rui3_at.h:96