File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 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() {
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+ */
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+ }
2541
2642/* -------------------------------------------------------------------------- */
2743int CWifi::begin (const char * ssid) {
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class CWifi {
5656 * Get firmware version
5757 */
5858 static const char * firmwareVersion ();
59+ uint32_t firmwareVersionU32 ();
5960
6061
6162 /*
You can’t perform that action at this time.
0 commit comments