File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 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() {
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/* -------------------------------------------------------------------------- */
2638int CWifi::begin (const char * ssid) {
2739/* -------------------------------------------------------------------------- */
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments