Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit af0787a

Browse files
andreagilardonipennam
authored andcommitted
added possibility to get fw version of wifi module as uint32
1 parent 9666fc2 commit af0787a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

‎libraries/WiFiS3/src/WiFi.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ const char* CWifi::firmwareVersion() {
2222
return "99.99.99";
2323
}
2424

25+
/* -------------------------------------------------------------------------- */
26+
uint32_t CWifi::firmwareVersionU32() {
27+
/* -------------------------------------------------------------------------- */
28+
uint8_t ret[4];
29+
string res = "";
30+
modem.begin();
31+
if(modem.write(string(PROMPT(_FWVERSION_U32)), res, CMD_READ(_FWVERSION_U32))) {
32+
return res[0] << 16| res[1] << 8 | res[2];
33+
}
34+
return 0x636363;
35+
}
36+
2537
/* -------------------------------------------------------------------------- */
2638
int CWifi::begin(const char* ssid) {
2739
/* -------------------------------------------------------------------------- */

‎libraries/WiFiS3/src/WiFi.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ class CWifi {
5757
* Get firmware version
5858
*/
5959
static const char* firmwareVersion();
60+
/*
61+
* Get firmware version U32
62+
*
63+
* Since version is made in a semver fashion, thus in an integer it will be represented as
64+
* byte 1 (MSB) | byte 2 | byte 3 | byte 4
65+
* 0 | MAJOR | MINOR | PATCH
66+
*/
67+
uint32_t firmwareVersionU32();
6068

6169
/*
6270
* PING

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /