mirror of https://github.com/ARMmbed/mbed-os.git
Fixed coverity warnings for targets folder. Also fixed one bug while copying sim.
parent
fa61f094db
commit
54ab974846
|
@ -136,7 +136,7 @@ bool CellularConnectionFSM::power_on()
|
||||||
void CellularConnectionFSM::set_sim_pin(const char * sim_pin)
|
void CellularConnectionFSM::set_sim_pin(const char * sim_pin)
|
||||||
{
|
{
|
||||||
strncpy(_sim_pin, sim_pin, sizeof(_sim_pin));
|
strncpy(_sim_pin, sim_pin, sizeof(_sim_pin));
|
||||||
_sim_pin[sizeof(_sim_pin)] = '\0';
|
_sim_pin[sizeof(_sim_pin)-1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CellularConnectionFSM::open_sim()
|
bool CellularConnectionFSM::open_sim()
|
||||||
|
|
|
@ -310,6 +310,7 @@ nsapi_error_t AT_CellularNetwork::connect()
|
||||||
|
|
||||||
nsapi_error_t AT_CellularNetwork::open_data_channel()
|
nsapi_error_t AT_CellularNetwork::open_data_channel()
|
||||||
{
|
{
|
||||||
|
#if NSAPI_PPP_AVAILABLE
|
||||||
tr_info("Open data channel in PPP mode");
|
tr_info("Open data channel in PPP mode");
|
||||||
_at.cmd_start("AT+CGDATA=\"PPP\",");
|
_at.cmd_start("AT+CGDATA=\"PPP\",");
|
||||||
_at.write_int(_cid);
|
_at.write_int(_cid);
|
||||||
|
@ -323,6 +324,9 @@ nsapi_error_t AT_CellularNetwork::open_data_channel()
|
||||||
* If blocking: mbed_ppp_init() is a blocking call, it will block until
|
* If blocking: mbed_ppp_init() is a blocking call, it will block until
|
||||||
connected, or timeout after 30 seconds*/
|
connected, or timeout after 30 seconds*/
|
||||||
return nsapi_ppp_connect(_at.get_file_handle(), callback(this, &AT_CellularNetwork::ppp_status_cb), NULL, NULL, _ip_stack_type);
|
return nsapi_ppp_connect(_at.get_file_handle(), callback(this, &AT_CellularNetwork::ppp_status_cb), NULL, NULL, _ip_stack_type);
|
||||||
|
#else
|
||||||
|
return NSAPI_ERROR_OK;
|
||||||
|
#endif // #if NSAPI_PPP_AVAILABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,7 +99,7 @@ void QUECTEL_BG96_CellularStack::handle_open_socket_response(int &modem_connect_
|
||||||
}
|
}
|
||||||
nsapi_error_t QUECTEL_BG96_CellularStack::create_socket_impl(CellularSocket *socket)
|
nsapi_error_t QUECTEL_BG96_CellularStack::create_socket_impl(CellularSocket *socket)
|
||||||
{
|
{
|
||||||
int modem_connect_id;
|
int modem_connect_id = -1;
|
||||||
int request_connect_id = socket->id;
|
int request_connect_id = socket->id;
|
||||||
int remote_port = 0;
|
int remote_port = 0;
|
||||||
int err = -1;
|
int err = -1;
|
||||||
|
@ -246,7 +246,9 @@ nsapi_size_or_error_t QUECTEL_BG96_CellularStack::socket_recvfrom_impl(CellularS
|
||||||
recv_len = _at.read_int();
|
recv_len = _at.read_int();
|
||||||
_at.read_string(ip_address, sizeof(ip_address));
|
_at.read_string(ip_address, sizeof(ip_address));
|
||||||
port = _at.read_int();
|
port = _at.read_int();
|
||||||
_at.read_bytes((uint8_t*)buffer, recv_len);
|
if (recv_len > 0) {
|
||||||
|
_at.read_bytes((uint8_t*)buffer, recv_len);
|
||||||
|
}
|
||||||
_at.resp_stop();
|
_at.resp_stop();
|
||||||
|
|
||||||
if (!recv_len || (_at.get_last_error() != NSAPI_ERROR_OK)) {
|
if (!recv_len || (_at.get_last_error() != NSAPI_ERROR_OK)) {
|
||||||
|
|
Loading…
Reference in New Issue