Fixed to call callback when connected...

pull/6082/head
Teppo Järvelin 2018-02-12 11:05:55 +02:00 committed by Ari Parkkila
parent 1dcc6684bf
commit 60f7054a45
3 changed files with 10 additions and 2 deletions

View File

@ -416,6 +416,11 @@ void CellularConnectionUtil::event()
case STATE_CONNECTED:
cellularDevice.set_timeout(TIMEOUT_NETWORK);
log_debug("Cellular ready! (timeout %d ms)", TIMEOUT_NETWORK);
if (_status_callback) {
if (!_status_callback(_state, _next_state)) {
return;
}
}
break;
default:
MBED_ASSERT(0);

View File

@ -146,5 +146,9 @@ const char *EasyCellularConnection::get_gateway()
NetworkStack *EasyCellularConnection::get_stack()
{
#if NSAPI_PPP_AVAILABLE
return nsapi_ppp_get_stack();
#else
return NULL;//cellularConnection.get_network();
#endif // #if NSAPI_PPP_AVAILABLE
}

View File

@ -126,9 +126,8 @@ private:
*/
bool cellular_status(int state, int next_state);
CellularConnectionUtil::CellularState _target_state;
bool _is_connected;
CellularConnectionUtil::CellularState _target_state;
};
#endif // EASY_CELLULAR_CONNECTION_H