added sending unconfirmed message for RHF76

1. added AT+ command "AT+MSGHEX" and change previous RHF76_ATCMD_FMT_SEND_MSGHEX to RHF76_ATCMD_FMT_SEND_CMSGHEX

2. implement send_unconfirmed with a non-breaking approach: added int (*send_unconfirmed)(const void *buf, size_t len); event handle in lora_module_st; added int tos_lora_module_send_unconfirmed(const void *buf, size_t len); in lora_module_wrapper.c; and implement static int rhf76_send_unconfirmed(const void *buf, size_t len) in RHF76.c

3. added { "+MSGHEX: PORT:", rhf76_incoming_data_process } in event array rhf76_at_event so that the device is able to process the downlink data when it is configurated to send unconfirmed message.

4. added AT+ command "AT+REPT", and implement the static int rhf76_set_repeat(uint8_t num) to enable user to set repeat times (1-15) while using "unconfirmed message"

5. updated the instructions of implemeting up-link parser and downlink parser on the server in the file "..\board\NUCLEO_STM32L073RZ\BSP\Src\lora_demo.c"
This commit is contained in:
Winfred LIN
2020-04-01 18:47:45 +11:00
parent eb6ffc8e95
commit cafe9c8a87
5 changed files with 127 additions and 15 deletions

View File

@@ -65,7 +65,10 @@ typedef enum lora_key_type {
#define RHF76_ATCMD_FMT_SET_KEY_TYPE_APPKEY "AT+KEY=\"appkey\",%s\r\n"
#define RHF76_ATCMD_FMT_SET_KEY_TYPE_APPSKEY "AT+KEY=\"appskey\",%s\r\n"
#define RHF76_ATCMD_FMT_SET_KEY_TYPE_NWKSKEY "AT+KEY=\"nwkskey\",%s\r\n"
#define RHF76_ATCMD_FMT_SEND_MSGHEX "AT+CMSGHEX=\"%s\"\r\n"
#define RHF76_ATCMD_FMT_SEND_CMSGHEX "AT+CMSGHEX=\"%s\"\r\n"
#define RHF76_ATCMD_FMT_SEND_MSGHEX "AT+MSGHEX=\"%s\"\r\n"
#define RHF76_ATCMD_SET_REPT "AT+REPT=%d\r\n"
#define RHF76_ATCMD_SET_BAND_CN470 "AT+DR=CN470\r\n"
#define RHF76_ATCMD_REPLY_BAND_CN470 "+DR: CN470"