@@ -21,10 +21,10 @@ GenericConnectionHandler::GenericConnectionHandler(bool const keep_alive)
2121: ConnectionHandler(keep_alive, NetworkAdapter::NONE, true ), _ch(nullptr ) { }
2222
2323bool GenericConnectionHandler::updateSetting (const models::NetworkSetting& s) {
24- if (_ch != nullptr && _ch->_current_net_connection_state != NetworkConnectionState::INIT) {
24+ if (_ch != nullptr && _ch->_current_net_connection_state > NetworkConnectionState::INIT) {
2525 // If the internal connection handler is already being used and not in INIT phase we cannot update the settings
2626 return false ;
27- } else if (_ch != nullptr && _ch->_current_net_connection_state = = NetworkConnectionState::INIT && _interface != s.type ) {
27+ } else if (_ch != nullptr && _ch->_current_net_connection_state < = NetworkConnectionState::INIT && _interface != s.type ) {
2828 // If the internal connection handler is already being used and in INIT phase and the interface type is being changed
2929 // -> we need to deallocate the previously allocated handler
3030
@@ -57,27 +57,31 @@ void GenericConnectionHandler::getSetting(models::NetworkSetting& s) {
5757}
5858
5959NetworkConnectionState GenericConnectionHandler::updateConnectionState () {
60- return _ch != nullptr ? _ch->updateConnectionState () : NetworkConnectionState::INIT;
60+ return _ch != nullptr ? _ch->updateConnectionState () : NetworkConnectionState::CHECK;
61+ }
62+
63+ NetworkConnectionState GenericConnectionHandler::update_handleCheck () {
64+ return _ch != nullptr ? _ch->update_handleCheck () : NetworkConnectionState::CHECK;
6165}
6266
6367NetworkConnectionState GenericConnectionHandler::update_handleInit () {
64- return _ch != nullptr ? _ch->update_handleInit () : NetworkConnectionState::INIT ;
68+ return _ch != nullptr ? _ch->update_handleInit () : NetworkConnectionState::CHECK ;
6569}
6670
6771NetworkConnectionState GenericConnectionHandler::update_handleConnecting () {
68- return _ch != nullptr ? _ch->update_handleConnecting () : NetworkConnectionState::INIT ;
72+ return _ch != nullptr ? _ch->update_handleConnecting () : NetworkConnectionState::CHECK ;
6973}
7074
7175NetworkConnectionState GenericConnectionHandler::update_handleConnected () {
72- return _ch != nullptr ? _ch->update_handleConnected () : NetworkConnectionState::INIT ;
76+ return _ch != nullptr ? _ch->update_handleConnected () : NetworkConnectionState::CHECK ;
7377}
7478
7579NetworkConnectionState GenericConnectionHandler::update_handleDisconnecting () {
76- return _ch != nullptr ? _ch->update_handleDisconnecting () : NetworkConnectionState::INIT ;
80+ return _ch != nullptr ? _ch->update_handleDisconnecting () : NetworkConnectionState::CHECK ;
7781}
7882
7983NetworkConnectionState GenericConnectionHandler::update_handleDisconnected () {
80- return _ch != nullptr ? _ch->update_handleDisconnected () : NetworkConnectionState::INIT ;
84+ return _ch != nullptr ? _ch->update_handleDisconnected () : NetworkConnectionState::CHECK ;
8185}
8286
8387#if not (defined(BOARD_HAS_LORA) or defined(BOARD_HAS_NOTECARD))
0 commit comments