Skip to content

Commit 6499bdf

Browse files
committed
Renaming _netConnectionState to _current_net_connection_state
1 parent 6503c26 commit 6499bdf

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/Arduino_ConnectionHandler.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
ConnectionHandler::ConnectionHandler(bool const keep_alive)
2929
: _keep_alive{keep_alive}
30-
, _netConnectionState{NetworkConnectionState::INIT}
30+
, _current_net_connection_state{NetworkConnectionState::INIT}
3131
, _lastConnectionTickTime{millis()}
3232
{
3333

@@ -40,40 +40,40 @@ ConnectionHandler::ConnectionHandler(bool const keep_alive)
4040
NetworkConnectionState ConnectionHandler::check()
4141
{
4242
unsigned long const now = millis();
43-
unsigned int const connectionTickTimeInterval = CHECK_INTERVAL_TABLE[static_cast<unsigned int>(_netConnectionState)];
43+
unsigned int const connectionTickTimeInterval = CHECK_INTERVAL_TABLE[static_cast<unsigned int>(_current_net_connection_state)];
4444

4545
if((now - _lastConnectionTickTime) > connectionTickTimeInterval)
4646
{
4747
_lastConnectionTickTime = now;
4848

49-
switch (_netConnectionState)
49+
switch (_current_net_connection_state)
5050
{
51-
case NetworkConnectionState::INIT: _netConnectionState = update_handleInit (); break;
52-
case NetworkConnectionState::CONNECTING: _netConnectionState = update_handleConnecting (); break;
53-
case NetworkConnectionState::CONNECTED: _netConnectionState = update_handleConnected (); break;
54-
case NetworkConnectionState::DISCONNECTING: _netConnectionState = update_handleDisconnecting(); break;
55-
case NetworkConnectionState::DISCONNECTED: _netConnectionState = update_handleDisconnected (); break;
56-
case NetworkConnectionState::ERROR: break;
57-
case NetworkConnectionState::CLOSED: break;
51+
case NetworkConnectionState::INIT: _current_net_connection_state = update_handleInit (); break;
52+
case NetworkConnectionState::CONNECTING: _current_net_connection_state = update_handleConnecting (); break;
53+
case NetworkConnectionState::CONNECTED: _current_net_connection_state = update_handleConnected (); break;
54+
case NetworkConnectionState::DISCONNECTING: _current_net_connection_state = update_handleDisconnecting(); break;
55+
case NetworkConnectionState::DISCONNECTED: _current_net_connection_state = update_handleDisconnected (); break;
56+
case NetworkConnectionState::ERROR: break;
57+
case NetworkConnectionState::CLOSED: break;
5858
}
5959
}
6060

61-
return _netConnectionState;
61+
return _current_net_connection_state;
6262
}
6363

6464
void ConnectionHandler::connect()
6565
{
66-
if (_netConnectionState != NetworkConnectionState::INIT && _netConnectionState != NetworkConnectionState::CONNECTING)
66+
if (_current_net_connection_state != NetworkConnectionState::INIT && _current_net_connection_state != NetworkConnectionState::CONNECTING)
6767
{
6868
_keep_alive = true;
69-
_netConnectionState = NetworkConnectionState::INIT;
69+
_current_net_connection_state = NetworkConnectionState::INIT;
7070
}
7171
}
7272

7373
void ConnectionHandler::disconnect()
7474
{
7575
_keep_alive = false;
76-
_netConnectionState = NetworkConnectionState::DISCONNECTING;
76+
_current_net_connection_state = NetworkConnectionState::DISCONNECTING;
7777
}
7878

7979
void ConnectionHandler::addCallback(NetworkConnectionEvent const event, OnNetworkEventCallback callback)

src/Arduino_ConnectionHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class ConnectionHandler {
171171
#endif
172172

173173
NetworkConnectionState getStatus() __attribute__((deprecated)) {
174-
return _netConnectionState;
174+
return _current_net_connection_state;
175175
}
176176

177177
void connect();
@@ -198,7 +198,7 @@ class ConnectionHandler {
198198
private:
199199

200200
unsigned long _lastConnectionTickTime;
201-
NetworkConnectionState _netConnectionState;
201+
NetworkConnectionState _current_net_connection_state;
202202
OnNetworkEventCallback _on_connect_event_callback = NULL,
203203
_on_disconnect_event_callback = NULL,
204204
_on_error_event_callback = NULL;

0 commit comments

Comments
 (0)