Skip to content

Commit

Permalink
Add RUI3 AT command AT+FIRMWAREVER
Browse files Browse the repository at this point in the history
  • Loading branch information
beegee-tokyo committed Jan 5, 2025
1 parent e5734ea commit 21ecb70
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Arduino library for RAKWireless WisBlock Core modules that takes all the LoRaWAN

# Release Notes

## 2.0.20 RUI3 AT command compatibility
- Add AT+FIRMWAREVER command

## 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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,8 @@ AT Command functions: Taylor Lee ([email protected])
----
# Changelog
[Code releases](CHANGELOG.md)
- 2025-01-05 RUI3 AT command compatibility
- Add AT+FIRMWAREVER command
- 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
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WisBlock-API-V2",
"version": "2.0.19",
"version": "2.0.20",
"keywords": [
"lora",
"Semtech",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=WisBlock-API-V2
version=2.0.19
version=2.0.20
author=Bernd Giesecke <[email protected]>
maintainer=Bernd Giesecke <[email protected]>
sentence=API for WisBlock Core module
Expand Down
2 changes: 1 addition & 1 deletion src/WisBlock-API-V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,5 +432,5 @@ extern uint16_t g_sw_ver_1; // major version increase on API change / not bac
extern uint16_t g_sw_ver_2; // minor version increase on API change / backward compatible
extern uint16_t g_sw_ver_3; // patch version increase on bugfix, no affect on API
extern String g_device_pid; // Product PID (if applicable)
extern String g_custom_fw_ver; // Custom firmware version
extern char g_custom_fw_ver[]; // Custom firmware version
#endif // WISBLOCK_API_H
2 changes: 1 addition & 1 deletion src/api_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ uint16_t g_sw_ver_3 = 0; // patch version increase on bugfix, no affect on API
#endif

String g_device_pid = "Custom";
String g_custom_fw_ver = "unset";
char g_custom_fw_ver[64] = "Custom firmware";

/** Buffer for device alias (WisToolBox) */
char g_alias[16] = {0x00};
Expand Down
25 changes: 16 additions & 9 deletions src/at_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1804,20 +1804,26 @@ static int at_query_snr(void)
}

/**
* @brief AT+VER=? Get firmware version and build date
* @brief AT+VER=? Get BSP version
*
* @return int AT_SUCCESS;
*/
static int at_query_version(void)
{
if (g_custom_fw_ver.equals("unset"))
{
snprintf(g_at_query_buf, ATQUERY_SIZE, "WisBlock API %d.%d.%d", WISBLOCK_API_VER, WISBLOCK_API_VER2, WISBLOCK_API_VER3);
}
else
{
snprintf(g_at_query_buf, ATQUERY_SIZE, "%s", g_custom_fw_ver.c_str());
}
snprintf(g_at_query_buf, ATQUERY_SIZE, "WisBlock API %d.%d.%d", WISBLOCK_API_VER, WISBLOCK_API_VER2, WISBLOCK_API_VER3);

return AT_SUCCESS;
}

/**
* @brief AT+FIRMWAREVER=? Get application version
*
* @return int AT_SUCCESS;
*/
static int at_query_app_version(void)
{
snprintf(g_at_query_buf, ATQUERY_SIZE, "%s", g_custom_fw_ver);

return AT_SUCCESS;
}

Expand Down Expand Up @@ -2373,6 +2379,7 @@ static atcmd_t g_at_cmd_list[] = {
{"+RSSI", "Last RX packet RSSI", at_query_rssi, NULL, NULL, "R"},
{"+SNR", "Last RX packet SNR", at_query_snr, NULL, NULL, "R"},
{"+VER", "Get SW version", at_query_version, NULL, NULL, "R"},
{"+FIRMWAREVER", "Get Application version", at_query_app_version, NULL, NULL, "R"},
// LoRa P2P management
{"+NWM", "Switch LoRa workmode", at_query_mode, at_exec_mode, NULL, "RW"},
{"+PFREQ", "Set P2P frequency", at_query_p2p_freq, at_exec_p2p_freq, NULL, "RW"},
Expand Down

0 comments on commit 21ecb70

Please sign in to comment.