@@ -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
@@ -39,8 +39,8 @@ bool GenericConnectionHandler::updateSetting(const models::NetworkSetting& s) {
3939
4040 if (_ch != nullptr ) {
4141 _interface = s.type ;
42- _ch-> setKeepAlive (_flags. keep_alive ) ;
43- _ch->enableCheckInternetAvailability ( _flags. check_internet_availability ); // TODO update this->flags
42+ _flags-> settings_provided = true ;
43+ _ch->_flags = _flags;
4444 return _ch->updateSetting (s);
4545 } else {
4646 _interface = NetworkAdapter::NONE;
@@ -58,27 +58,31 @@ void GenericConnectionHandler::getSetting(models::NetworkSetting& s) {
5858}
5959
6060NetworkConnectionState GenericConnectionHandler::updateConnectionState () {
61- return _ch != nullptr ? _ch->updateConnectionState () : NetworkConnectionState::INIT;
61+ return _ch != nullptr ? _ch->updateConnectionState () : NetworkConnectionState::CHECK;
62+ }
63+
64+ NetworkConnectionState GenericConnectionHandler::update_handleCheck () {
65+ return _ch != nullptr ? _ch->update_handleCheck () : NetworkConnectionState::CHECK;
6266}
6367
6468NetworkConnectionState GenericConnectionHandler::update_handleInit () {
65- return _ch != nullptr ? _ch->update_handleInit () : NetworkConnectionState::INIT ;
69+ return _ch != nullptr ? _ch->update_handleInit () : NetworkConnectionState::CHECK ;
6670}
6771
6872NetworkConnectionState GenericConnectionHandler::update_handleConnecting () {
69- return _ch != nullptr ? _ch->update_handleConnecting () : NetworkConnectionState::INIT ;
73+ return _ch != nullptr ? _ch->update_handleConnecting () : NetworkConnectionState::CHECK ;
7074}
7175
7276NetworkConnectionState GenericConnectionHandler::update_handleConnected () {
73- return _ch != nullptr ? _ch->update_handleConnected () : NetworkConnectionState::INIT ;
77+ return _ch != nullptr ? _ch->update_handleConnected () : NetworkConnectionState::CHECK ;
7478}
7579
7680NetworkConnectionState GenericConnectionHandler::update_handleDisconnecting () {
77- return _ch != nullptr ? _ch->update_handleDisconnecting () : NetworkConnectionState::INIT ;
81+ return _ch != nullptr ? _ch->update_handleDisconnecting () : NetworkConnectionState::CHECK ;
7882}
7983
8084NetworkConnectionState GenericConnectionHandler::update_handleDisconnected () {
81- return _ch != nullptr ? _ch->update_handleDisconnected () : NetworkConnectionState::INIT ;
85+ return _ch != nullptr ? _ch->update_handleDisconnected () : NetworkConnectionState::CHECK ;
8286}
8387
8488#if not (defined(BOARD_HAS_LORA) or defined(BOARD_HAS_NOTECARD))
0 commit comments