Skip to content

Commit

Permalink
added possibility to get fw version of wifi module as uint32
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Nov 21, 2024
1 parent b8876ad commit 8942cff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libraries/WiFiS3/src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ 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] << 24| res[1] << 16 | res[2] << 8 | res[3];
}
return 0x63636300;
}

/* -------------------------------------------------------------------------- */
int CWifi::begin(const char* ssid) {
Expand Down
1 change: 1 addition & 0 deletions libraries/WiFiS3/src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CWifi {
* Get firmware version
*/
static const char* firmwareVersion();
uint32_t firmwareVersionU32();


/*
Expand Down

0 comments on commit 8942cff

Please sign in to comment.