Skip to content

Commit d887ec0

Browse files
committed
fix for compile
1 parent ad6ec01 commit d887ec0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Arduino_NetworkConfigurator.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
#include "ANetworkConfigurator_Config.h"
99
#if NETWORK_CONFIGURATOR_COMPATIBLE
10+
#include "Arduino_NetworkConfigurator.h"
1011

1112
#include <Arduino_DebugUtils.h>
1213
#include "ConnectionHandlerDefinitions.h"
@@ -15,7 +16,6 @@
1516
#ifdef BOARD_HAS_WIFI
1617
#include "WiFiConnectionHandler.h"
1718
#endif
18-
#include "Arduino_NetworkConfigurator.h"
1919

2020
#define NC_CONNECTION_RETRY_TIMER_ms 120000
2121
#define NC_CONNECTION_TIMEOUT_ms 15000
@@ -71,14 +71,14 @@ bool NetworkConfiguratorClass::begin() {
7171
DEBUG_ERROR(F("The current WiFi firmware version is not the latest and it may cause compatibility issues. Please upgrade the WiFi firmware"));
7272
}
7373
_agentsManager->addRequestHandler(RequestType::SCAN, scanReqHandler);
74+
75+
_agentsManager->addRequestHandler(RequestType::GET_WIFI_FW_VERSION, getWiFiFWVersionHandler);
7476
#endif
7577
// Register callbacks to agentsManager
7678
_agentsManager->addRequestHandler(RequestType::CONNECT, connectReqHandler);
7779

7880
_agentsManager->addReturnNetworkSettingsCallback(setNetworkSettingsHandler);
7981

80-
_agentsManager->addRequestHandler(RequestType::GET_WIFI_FW_VERSION, getWiFiFWVersionHandler);
81-
8282
_agentsManager->addRequestHandler(RequestType::GET_NETCONFIG_LIB_VERSION, getNetConfLibVersionHandler);
8383

8484
if (!_agentsManager->begin()) {
@@ -419,7 +419,10 @@ String NetworkConfiguratorClass::decodeConnectionErrorMessage(NetworkConnectionS
419419
}
420420

421421
void NetworkConfiguratorClass::handleGetWiFiFWVersion() {
422-
String fwVersion = WiFi.firmwareVersion();
422+
String fwVersion = "";
423+
#ifdef BOARD_HAS_WIFI
424+
fwVersion = WiFi.firmwareVersion();
425+
#endif
423426
ProvisioningOutputMessage fwVersionMsg = { MessageOutputType::WIFI_FW_VERSION };
424427
fwVersionMsg.m.wifiFwVersion = fwVersion.c_str();
425428
_agentsManager->sendMsg(fwVersionMsg);

0 commit comments

Comments
 (0)