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: modem_ref.cpp
- Revision:
- 6:581caeee80e8
- Parent:
- 5:32ccddf80952
- Child:
- 8:97875739f11a
--- a/modem_ref.cpp Thu May 11 15:18:49 2017 +0000 +++ b/modem_ref.cpp Fri May 12 10:57:57 2017 +0000 @@ -143,7 +143,7 @@ switch (r.type) { case ALP_OPCODE_RSP_F_DATA: - case ALP_OPCODE_RSP_F_PROP: // Not supported but comes for free ... + case ALP_OPCODE_RSP_F_PROP: ASSERT(g_modem.user[id].data != NULL,"ASSERT: NULL Data Buffer for RD on ID %d\n",id); memcpy(g_modem.user[id].data,r.data,r.meta.f_data.length); break; @@ -159,12 +159,13 @@ break; } } - g_modem.user[id].cb(eop,err,id); if(eop) { // This is mainly for debug, catch old pointers //g_modem.user[id].data = NULL; //g_modem.user[id].istatus= NULL; } + // User Callback + g_modem.user[id].cb(eop,err,id); break; case WC_FLOW_SYS_RST: // 'Software' reset request @@ -258,6 +259,17 @@ SERIAL_SEND(WC_FLOW_ALP_UNS,tmp, (u8)(p-tmp)); } +public void modem_read_fprop(u8 fid, alp_file_header_t* data, u8 id) +{ + u8 tmp[ALP_ACTION_TAG_SIZE + ALP_ACTION_F_RD_PROP_SIZE]; + u8* p = tmp; + DPRINT(L_API, "RD PROPS[%d]\n",fid); + g_modem.user[id].data = (u8*)data; + ALP_ACTION_TAG(p,id,true); + ALP_ACTION_F_RD_PROP(p,true,fid); + SERIAL_SEND(WC_FLOW_ALP_UNS,tmp, (u8)(p-tmp)); +} + public void modem_write_file(u8 fid,void *data,u32 offset,u32 length, u8 id) { ALLOC_BUFFER(u8,tmp,(ALP_ACTION_TAG_SIZE + ALP_ACTION_F_WR_DATA_SIZE_MAX(length))); @@ -327,10 +339,11 @@ DEALLOC_BUFFER(tmp); } -public void modem_send_file_content(u8* itf, u8 itf_length,u8 fid,void *data,u32 offset,u32 length, u8 id) +public void modem_send_file_content(u8* itf, u8 itf_length, void *istatus, u8 fid,void *data,u32 offset,u32 length, u8 id) { ALLOC_BUFFER(u8,tmp,ALP_ACTION_TAG_SIZE + ALP_ACTION_FORWARD_SIZE(itf_length) + ALP_ACTION_RSP_F_DATA_SIZE_MAX(length)); u8* p = tmp; + g_modem.user[id].istatus= (u8*)istatus; REF_PRINT("SEND FILE[%d] CONTENTS @%d %d Bytes (itf %d Bytes)\n",fid,offset,length,itf_length); ALP_ACTION_TAG(p,id,true);