Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: modem_ref_helper_for_v5_3_217
Diff: src/modem_ref.cpp
- Revision:
- 21:d5018a680915
- Parent:
- 20:17852941b19e
- Child:
- 23:5553f9541759
diff -r 17852941b19e -r d5018a680915 src/modem_ref.cpp
--- a/src/modem_ref.cpp Wed Dec 13 14:29:27 2017 +0000
+++ b/src/modem_ref.cpp Thu Dec 14 19:16:25 2017 +0000
@@ -40,6 +40,7 @@
#define ROOT_KEY_SIZE 16
#define SERIAL_SEND(_flow,_data,_size) do { \
+ ASSERT(_size<256, "SERIAL_SEND too big for serial protocol (%d/%dmax)", _size, 255);\
u8 wch[WC_HEADER_SIZE] = {WC_SYNC_BYTE_0,WC_SYNC_BYTE_1,_size,g_modem.tx_sequ++,_flow};\
g_modem.send(wch,WC_HEADER_SIZE,_data,_size);\
}while(0)
@@ -92,6 +93,8 @@
switch (r.type)
{
case ALP_OPCODE_F_RD_DATA:
+ ASSERT((ALP_ACTION_RSP_TAG_SIZE + ALP_ACTION_RSP_F_DATA_SIZE_MAX(r.meta.f_data.length)) < 256,
+ "F_RD_DATA too big for serial protocol (%d/%dmax)", r.meta.f_data.length, 255 - (ALP_ACTION_RSP_TAG_SIZE + ALP_ACTION_RSP_F_DATA_SIZE_MAX(0)));
g_modem.cb->read(r.meta.f_data.fid,r.meta.f_data.offset,r.meta.f_data.length,id);
break;
case ALP_OPCODE_F_WR_DATA: