Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
added possibility to get fw version of wifi module as uint32
  • Loading branch information
andreagilardoni authored and pennam committed Nov 27, 2024
commit af0787a991a2befed636e1d3365a5d269dacad80
12 changes: 12 additions & 0 deletions libraries/WiFiS3/src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ const char* CWifi::firmwareVersion() {
return "99.99.99";
}

/* -------------------------------------------------------------------------- */
uint32_t CWifi::firmwareVersionU32() {
/* -------------------------------------------------------------------------- */
uint8_t ret[4];
string res = "";
modem.begin();
if(modem.write(string(PROMPT(_FWVERSION_U32)), res, CMD_READ(_FWVERSION_U32))) {
return res[0] << 16| res[1] << 8 | res[2];
}
return 0x636363;
}

/* -------------------------------------------------------------------------- */
int CWifi::begin(const char* ssid) {
/* -------------------------------------------------------------------------- */
Expand Down
8 changes: 8 additions & 0 deletions libraries/WiFiS3/src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ class CWifi {
* Get firmware version
*/
static const char* firmwareVersion();
/*
* Get firmware version U32
*
* Since version is made in a semver fashion, thus in an integer it will be represented as
* byte 1 (MSB) | byte 2 | byte 3 | byte 4
* 0 | MAJOR | MINOR | PATCH
*/
uint32_t firmwareVersionU32();

/*
* PING
Expand Down
Loading