mirror of https://github.com/ARMmbed/mbed-os.git
Cellular: Fix requested socket id in socket_connect routines of BG96 and M26
parent
9cc1caa031
commit
ff2061aba4
6
features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp
Normal file → Executable file
6
features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp
Normal file → Executable 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=");
|
||||
|
|
8
features/cellular/framework/targets/QUECTEL/M26/QUECTEL_M26_CellularStack.cpp
Normal file → Executable file
8
features/cellular/framework/targets/QUECTEL/M26/QUECTEL_M26_CellularStack.cpp
Normal file → Executable 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=");
|
||||
|
|
Loading…
Reference in New Issue