diff --git a/CHANGELOG.md b/CHANGELOG.md index 927fd96..3686654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Arduino library for RAKWireless WisBlock Core modules that takes all the LoRaWAN # Release Notes +## 2.0.19 AT command parsing and default fPort changes + - Allow upper and lower case and special characters in AT commands after the "=" + - Change LoRaWAN default fPort from 0 to 1 + ## 2.0.18 Fix dependency to CayenneLPP - Ownership of library has changed, PIO couldn't find the library diff --git a/README.md b/README.md index 2ed2131..0440a10 100644 --- a/README.md +++ b/README.md @@ -395,7 +395,7 @@ uint8_t g_user_at_cmd_num = sizeof(g_user_at_cmd_list_example) / sizeof(atcmd_t) These five examples explain the usage of the API. In all examples the API callbacks and the additional functions (sensor readings, IRQ handling, GNSS location service) are separated into their own sketches. - The simplest example (_**api-test.ino**_) just sends a 3 byte packet with the values 0x10, 0x00, 0x00. -- The other examples send their data encoded in the same format as RAKwireless WisNode devices. An explanation of the data format can be found in the RAKwireless [Documentation Center](https://docs.rakwireless.com/Product-Categories/WisTrio/RAK7205-5205/Quickstart/#decoding-sensor-data-on-chirpstack-and-ttn) :arrow_upper_right:. A ready to use packet decoder can be found in the RAKwireless Github repos in [RAKwireless_Standardized_Payload](https://github.com/RAKWireless/RAKwireless_Standardized_Payload) :arrow_upper_right: +- The other examples send their data encoded in the same format as RAKwireless WisNode devices. An explanation of the data format can be found in the RAKwireless [Documentation Center](https://docs.rakwireless.com/Product-Categories/WisTrio/RAK7205-5205/Quickstart/#decoding-sensor-data-on-chirpstack-and-ttn) :arrow_upper_right:. A ready to use packet decoder can be found in the RAKwireless Github repos in [RUI_LoRa_node_payload_decoder](https://github.com/RAKWireless/RUI_LoRa_node_payload_decoder) :arrow_upper_right: - The LoRa P2P example (_**LoRa-P2P.ino**_) listens for P2P packets and displays them in the log. _**The WisBlock-API-V2 has been used as well in the following PlatformIO projects:**_ @@ -1227,7 +1227,9 @@ AT Command functions: Taylor Lee (taylor.lee@rakwireless.com) ---- # Changelog [Code releases](CHANGELOG.md) - +- 2024-10-17 AT command parsing and default fPort changes + - Allow upper and lower case and special characters in AT commands after the "=" + - Change LoRaWAN default fPort from 0 to 1 - 2024-06-26 Fix dependency to CayenneLPP - Ownership of library has changed, PIO couldn't find the library - 2023-12-24 Rework AT commands diff --git a/library.json b/library.json index 85a0e59..baa6d5c 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "WisBlock-API-V2", - "version": "2.0.18", + "version": "2.0.19", "keywords": [ "lora", "Semtech", diff --git a/library.properties b/library.properties index 2d9e947..32a1826 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=WisBlock-API-V2 -version=2.0.18 +version=2.0.19 author=Bernd Giesecke maintainer=Bernd Giesecke sentence=API for WisBlock Core module diff --git a/src/WisBlock-API-V2.h b/src/WisBlock-API-V2.h index 605328c..1655256 100644 --- a/src/WisBlock-API-V2.h +++ b/src/WisBlock-API-V2.h @@ -175,7 +175,7 @@ int8_t init_lora(void); int8_t init_lorawan(bool region_change = false); int8_t re_init_lorawan(void); bool send_p2p_packet(uint8_t *data, uint8_t size); -lmh_error_status send_lora_packet(uint8_t *data, uint8_t size, uint8_t fport = 0); +lmh_error_status send_lora_packet(uint8_t *data, uint8_t size, uint8_t fport = 1); extern bool g_lpwan_has_joined; extern bool g_rx_fin_result; extern bool g_join_result; diff --git a/src/at_cmd.cpp b/src/at_cmd.cpp index f553679..117e223 100644 --- a/src/at_cmd.cpp +++ b/src/at_cmd.cpp @@ -2829,6 +2829,8 @@ static void at_cmd_handle(void) return; } +bool convert_to_upper = true; + /** * @brief Get Serial input and start parsing * @@ -2845,21 +2847,32 @@ void at_serial_input(uint8_t cmd) Serial.printf(" \b"); } - // Convert to uppercase - if (cmd >= 'a' && cmd <= 'z') + if (cmd == '=') { - cmd = toupper(cmd); + // Stop conversion to upper case + convert_to_upper = false; + } + + if (convert_to_upper) + { // Convert to uppercase + if (cmd >= 'a' && cmd <= 'z') + { + cmd = toupper(cmd); + } } // Check valid character - if ((cmd >= '0' && cmd <= '9') || (cmd >= 'a' && cmd <= 'z') || - (cmd >= 'A' && cmd <= 'Z') || cmd == '?' || cmd == '+' || cmd == ':' || - cmd == '=' || cmd == ' ' || cmd == ',' || cmd == '.' || cmd == '_') + // if ((cmd >= '0' && cmd <= '9') || (cmd >= 'a' && cmd <= 'z') || + // (cmd >= 'A' && cmd <= 'Z') || cmd == '?' || cmd == '+' || cmd == ':' || + // cmd == '=' || cmd == ' ' || cmd == ',' || cmd == '.' || cmd == '_' || + // cmd == '&' || cmd == '\\' || cmd == '/' || cmd == '@') + if ((cmd >= 0x20 && cmd <= 0x7E)) { atcmd[atcmd_index++] = cmd; } else if (cmd == '\r' || cmd == '\n') { + convert_to_upper = true; atcmd[atcmd_index] = '\0'; at_cmd_handle(); }