File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,22 @@ const char* CWifi::firmwareVersion() {
22
22
return " 99.99.99" ;
23
23
}
24
24
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
+ */
30
+ /* -------------------------------------------------------------------------- */
31
+ uint32_t CWifi::firmwareVersionU32 () {
32
+ /* -------------------------------------------------------------------------- */
33
+ uint8_t ret[4 ];
34
+ string res = " " ;
35
+ modem.begin ();
36
+ if (modem.write (string (PROMPT (_FWVERSION_U32)), res, CMD_READ (_FWVERSION_U32))) {
37
+ return res[0 ] << 16 | res[1 ] << 8 | res[2 ];
38
+ }
39
+ return 0x636363 ;
40
+ }
25
41
26
42
/* -------------------------------------------------------------------------- */
27
43
int CWifi::begin (const char * ssid) {
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class CWifi {
56
56
* Get firmware version
57
57
*/
58
58
static const char * firmwareVersion ();
59
+ uint32_t firmwareVersionU32 ();
59
60
60
61
61
62
/*
You can’t perform that action at this time.
0 commit comments