Skip to content

Commit 483a3b8

Browse files
fixup! added possibility to get fw version of wifi module as uint32
1 parent 8942cff commit 483a3b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: libraries/WiFiS3/src/WiFi.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,21 @@ const char* CWifi::firmwareVersion() {
2222
return "99.99.99";
2323
}
2424

25+
/*
26+
* Since version is made in a semver fashion, thus in an integer it will be represented as
27+
* byte 1 (MSB) | byte 2 | byte 3 | byte 4
28+
* 0 | MAJOR | MINOR | PATCH
29+
*/
2530
/* -------------------------------------------------------------------------- */
2631
uint32_t CWifi::firmwareVersionU32() {
2732
/* -------------------------------------------------------------------------- */
2833
uint8_t ret[4];
2934
string res = "";
3035
modem.begin();
3136
if(modem.write(string(PROMPT(_FWVERSION_U32)), res, CMD_READ(_FWVERSION_U32))) {
32-
return res[0] << 24| res[1] << 16 | res[2] << 8 | res[3];
37+
return res[0] << 16| res[1] << 8 | res[2];
3338
}
34-
return 0x63636300;
39+
return 0x636363;
3540
}
3641

3742
/* -------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)