File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,18 @@ const char* CWifi::firmwareVersion() {
22
22
return " 99.99.99" ;
23
23
}
24
24
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
+
25
37
/* -------------------------------------------------------------------------- */
26
38
int CWifi::begin (const char * ssid) {
27
39
/* -------------------------------------------------------------------------- */
Original file line number Diff line number Diff line change @@ -57,6 +57,14 @@ class CWifi {
57
57
* Get firmware version
58
58
*/
59
59
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 ();
60
68
61
69
/*
62
70
* PING
You can’t perform that action at this time.
0 commit comments