File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class ConnectionHandler {
5151
5252 virtual ~ConnectionHandler () {}
5353
54- NetworkConnectionState check ();
54+ virtual NetworkConnectionState check ();
5555
5656 #if not defined(BOARD_HAS_LORA)
5757 virtual unsigned long getTime () = 0;
Original file line number Diff line number Diff line change 2222static inline ConnectionHandler* instantiate_handler (NetworkAdapter adapter);
2323
2424bool GenericConnectionHandler::updateSetting (const models::NetworkSetting& s) {
25- if (_ch != nullptr && _current_net_connection_state != NetworkConnectionState::INIT) {
25+ if (_ch != nullptr && _ch-> _current_net_connection_state != NetworkConnectionState::INIT) {
2626 // If the internal connection handler is already being used and not in INIT phase we cannot update the settings
2727 return false ;
28- } else if (_ch != nullptr && _current_net_connection_state == NetworkConnectionState::INIT && _interface != s.type ) {
28+ } else if (_ch != nullptr && _ch-> _current_net_connection_state == NetworkConnectionState::INIT && _interface != s.type ) {
2929 // If the internal connection handler is already being used and in INIT phase and the interface type is being changed
3030 // -> we need to deallocate the previously allocated handler
3131
@@ -49,6 +49,11 @@ bool GenericConnectionHandler::updateSetting(const models::NetworkSetting& s) {
4949 }
5050}
5151
52+ NetworkConnectionState GenericConnectionHandler::check ()
53+ {
54+ return _ch != nullptr ? _ch->check () : NetworkConnectionState::INIT;
55+ }
56+
5257NetworkConnectionState GenericConnectionHandler::update_handleInit () {
5358 return _ch != nullptr ? _ch->update_handleInit () : NetworkConnectionState::INIT;
5459}
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ class GenericConnectionHandler : public ConnectionHandler
3838
3939 GenericConnectionHandler (bool const keep_alive=true ): ConnectionHandler(keep_alive), _ch(nullptr ) {}
4040
41+ NetworkConnectionState check () override ;
42+
4143 #if defined(BOARD_HAS_NOTECARD) || defined(BOARD_HAS_LORA)
4244 virtual bool available () = 0;
4345 virtual int read () = 0;
You can’t perform that action at this time.
0 commit comments