File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class ConnectionHandler {
51
51
52
52
virtual ~ConnectionHandler () {}
53
53
54
- NetworkConnectionState check ();
54
+ virtual NetworkConnectionState check ();
55
55
56
56
#if not defined(BOARD_HAS_LORA)
57
57
virtual unsigned long getTime () = 0;
Original file line number Diff line number Diff line change 22
22
static inline ConnectionHandler* instantiate_handler (NetworkAdapter adapter);
23
23
24
24
bool 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) {
26
26
// If the internal connection handler is already being used and not in INIT phase we cannot update the settings
27
27
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 ) {
29
29
// If the internal connection handler is already being used and in INIT phase and the interface type is being changed
30
30
// -> we need to deallocate the previously allocated handler
31
31
@@ -49,6 +49,11 @@ bool GenericConnectionHandler::updateSetting(const models::NetworkSetting& s) {
49
49
}
50
50
}
51
51
52
+ NetworkConnectionState GenericConnectionHandler::check ()
53
+ {
54
+ return _ch != nullptr ? _ch->check () : NetworkConnectionState::INIT;
55
+ }
56
+
52
57
NetworkConnectionState GenericConnectionHandler::update_handleInit () {
53
58
return _ch != nullptr ? _ch->update_handleInit () : NetworkConnectionState::INIT;
54
59
}
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ class GenericConnectionHandler : public ConnectionHandler
38
38
39
39
GenericConnectionHandler (bool const keep_alive=true ): ConnectionHandler(keep_alive), _ch(nullptr ) {}
40
40
41
+ NetworkConnectionState check () override ;
42
+
41
43
#if defined(BOARD_HAS_NOTECARD) || defined(BOARD_HAS_LORA)
42
44
virtual bool available () = 0;
43
45
virtual int read () = 0;
You can’t perform that action at this time.
0 commit comments