Cellular: Fix requested socket id in socket_connect routines of BG96 and M26

pull/10764/head
Mirela Chirica 2019-05-30 13:36:43 +03:00
parent 9cc1caa031
commit ff2061aba4
2 changed files with 10 additions and 4 deletions

View File

@ -50,9 +50,13 @@ nsapi_error_t QUECTEL_BG96_CellularStack::socket_connect(nsapi_socket_t handle,
CellularSocket *socket = (CellularSocket *)handle;
int modem_connect_id = -1;
int request_connect_id = socket->id;
int err = -1;
int request_connect_id = find_socket_index(socket);
// assert here as its a programming error if the socket container doesn't contain
// specified handle
MBED_ASSERT(request_connect_id != -1);
_at.lock();
if (socket->proto == NSAPI_TCP) {
_at.cmd_start("AT+QIOPEN=");

View File

@ -302,12 +302,14 @@ nsapi_error_t QUECTEL_M26_CellularStack::socket_connect(nsapi_socket_t handle, c
{
CellularSocket *socket = (CellularSocket *)handle;
MBED_ASSERT(socket->id != -1);
int modem_connect_id = -1;
int request_connect_id = socket->id;
int err = -1;
int request_connect_id = find_socket_index(socket);
// assert here as its a programming error if the socket container doesn't contain
// specified handle
MBED_ASSERT(request_connect_id != -1);
_at.lock();
if (socket->proto == NSAPI_TCP) {
_at.cmd_start("AT+QIOPEN=");