Skip to content

Commit 3cc31bc

Browse files
committed
rename NETWORK_CONFIGURATOR_ENABLED to HAS_NETWORK_CONFIGURATOR
1 parent f9be897 commit 3cc31bc

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

src/AIoTC_Config.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
#endif
2525

2626
#if __has_include (<ANetworkConfigurator_Config.h>)
27-
#define NETWORK_CONFIGURATOR_ENABLED (1)
28-
#else
29-
#define NETWORK_CONFIGURATOR_ENABLED (0)
27+
#define HAS_NETWORK_CONFIGURATOR
3028
#endif
3129

3230
#endif

src/ArduinoIoTCloud.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
ArduinoIoTCloudClass::ArduinoIoTCloudClass()
2929
: _connection{nullptr}
30-
#if NETWORK_CONFIGURATOR_ENABLED
30+
#if defined (HAS_NETWORK_CONFIGURATOR)
3131
, _configurator{nullptr}
3232
#endif
3333
, _time_service(TimeService)

src/ArduinoIoTCloud.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ class ArduinoIoTCloudClass
104104
inline unsigned long getInternalTime() { return _time_service.getTime(); }
105105
inline unsigned long getLocalTime() { return _time_service.getLocalTime(); }
106106

107-
#if NETWORK_CONFIGURATOR_ENABLED
107+
#if defined (HAS_NETWORK_CONFIGURATOR)
108108
inline void setConfigurator(NetworkConfiguratorClass & configurator) { _configurator = &configurator; }
109-
#endif
109+
#endif
110110
void addCallback(ArduinoIoTCloudEvent const event, OnCloudEventCallback callback);
111111

112112
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
@@ -152,9 +152,9 @@ class ArduinoIoTCloudClass
152152
protected:
153153

154154
ConnectionHandler * _connection;
155-
#if NETWORK_CONFIGURATOR_ENABLED
155+
#if defined (HAS_NETWORK_CONFIGURATOR)
156156
NetworkConfiguratorClass * _configurator;
157-
#endif
157+
#endif
158158
TimeServiceClass & _time_service;
159159
String _thing_id;
160160
String _lib_version;

src/ArduinoIoTCloudTCP.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
188188
}
189189
#endif
190190

191-
#if NETWORK_CONFIGURATOR_ENABLED
191+
#if defined (HAS_NETWORK_CONFIGURATOR)
192192
if(_configurator != nullptr){
193193
_configurator->enableAgent(ConfiguratorAgent::AgentTypes::BLE,false);
194194
_configurator->begin();
@@ -233,11 +233,11 @@ void ArduinoIoTCloudTCP::update()
233233
/* Poll the network configurator to check if it is updating the configuration.
234234
* The polling must be performed only if the the first configuration is completed.
235235
*/
236-
#if NETWORK_CONFIGURATOR_ENABLED
236+
#if defined (HAS_NETWORK_CONFIGURATOR)
237237
if(_configurator != nullptr && _state > State::Init && _configurator->update() == NetworkConfiguratorStates::UPDATING_CONFIG){
238238
_state = State::ConfigPhy;
239239
}
240-
#endif
240+
#endif
241241

242242
#if OTA_ENABLED
243243
/* OTA FSM needs to reach the Idle state before being able to run independently from
@@ -293,7 +293,7 @@ void ArduinoIoTCloudTCP::disconnect() {
293293

294294
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConfigPhy()
295295
{
296-
#if NETWORK_CONFIGURATOR_ENABLED
296+
#if defined (HAS_NETWORK_CONFIGURATOR)
297297
if (_configurator == nullptr) {
298298
return State::Init;
299299
}

0 commit comments

Comments
 (0)