Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"SPI_MOSI": "PA_7",
"SPI_MISO": "PA_6",
"SPI_CLK": "PA_5",
"SPI_CS": "PB_12"
"SPI_CS": "PB_12",
"SPI_FREQ": "20000000"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "CellularUtil.h"
#include "CellularLog.h"

#define PACKET_SIZE_MAX 1358

using namespace mbed;
using namespace mbed_cellular_util;

Expand Down Expand Up @@ -174,6 +176,10 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc
{
int sent_len = 0;

if (size > PACKET_SIZE_MAX) {
return NSAPI_ERROR_PARAMETER;
}

char *hexstr = new char[size * 2 + 1];
int hexlen = char_str_to_hex_str((const char *)data, size, hexstr);
// NULL terminated for write_string
Expand Down Expand Up @@ -220,7 +226,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_recvfrom_impl(CellularS

_at.cmd_start("AT+NSORF=");
_at.write_int(socket->id);
_at.write_int(size);
_at.write_int(size <= PACKET_SIZE_MAX ? size : PACKET_SIZE_MAX);
_at.cmd_stop();
_at.resp_start();
// receiving socket id
Expand Down