From 8942cff842f34d8fdc11e5a5f495540b33097a59 Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Mon, 27 May 2024 17:12:09 +0200 Subject: [PATCH] added possibility to get fw version of wifi module as uint32 --- libraries/WiFiS3/src/WiFi.cpp | 11 +++++++++++ libraries/WiFiS3/src/WiFi.h | 1 + 2 files changed, 12 insertions(+) diff --git a/libraries/WiFiS3/src/WiFi.cpp b/libraries/WiFiS3/src/WiFi.cpp index 09d0f539..3160dc19 100644 --- a/libraries/WiFiS3/src/WiFi.cpp +++ b/libraries/WiFiS3/src/WiFi.cpp @@ -22,6 +22,17 @@ const char* CWifi::firmwareVersion() { return "99.99.99"; } +/* -------------------------------------------------------------------------- */ +uint32_t CWifi::firmwareVersionU32() { +/* -------------------------------------------------------------------------- */ + uint8_t ret[4]; + string res = ""; + modem.begin(); + if(modem.write(string(PROMPT(_FWVERSION_U32)), res, CMD_READ(_FWVERSION_U32))) { + return res[0] << 24| res[1] << 16 | res[2] << 8 | res[3]; + } + return 0x63636300; +} /* -------------------------------------------------------------------------- */ int CWifi::begin(const char* ssid) { diff --git a/libraries/WiFiS3/src/WiFi.h b/libraries/WiFiS3/src/WiFi.h index 5384be0b..0a7edb33 100644 --- a/libraries/WiFiS3/src/WiFi.h +++ b/libraries/WiFiS3/src/WiFi.h @@ -56,6 +56,7 @@ class CWifi { * Get firmware version */ static const char* firmwareVersion(); + uint32_t firmwareVersionU32(); /*