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:
- 44:656cbcc7843b
- Parent:
- 41:6f83174ffed4
- Child:
- 45:6a4c373e1178
diff -r 6e3b117f1d67 -r 656cbcc7843b src/modem_ref.cpp
--- a/src/modem_ref.cpp Fri Feb 08 17:43:02 2019 +0000
+++ b/src/modem_ref.cpp Wed Feb 20 13:36:50 2019 +0000
@@ -664,7 +664,7 @@
DEALLOC_BUFFER(tmp);
}
-public void modem_remote_write_file(u8* itf, u8 itf_length, void *istatus , u8 fid, void *data, u32 offset, u32 length, u8 id)
+public void modem_remote_write_file(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_F_WR_DATA_SIZE_MAX(length));
u8* p = tmp;
@@ -678,6 +678,47 @@
DEALLOC_BUFFER(tmp);
}
+public void modem_remote_write_file_root(u8* itf, u8 itf_length, void *istatus, u8 fid, void *data, u32 offset, u32 length, u8* root_key, u8 id)
+{
+ ALLOC_BUFFER(u8, tmp, (ALP_ACTION_TAG_SIZE + ALP_ACTION_FORWARD_SIZE(itf_length) + ALP_ACTION_PERM_REQ_SIZE(ALP_ACTION_F_WR_DATA_SIZE_MAX(length))));
+
+ u8* p = tmp;
+ u8* actp;
+ u8* reqp;
+
+ g_modem.user[id].istatus = (u8*)istatus;
+
+ REF_PRINT("WR (ROOT)[%d]@%d %d Bytes\n",fid,offset,length);
+ ASSERT(root_key != NULL, "Missing ROOT KEY\n");
+
+ // TAG and FORWARD
+ ALP_ACTION_TAG(p, id, true);
+ ALP_ACTION_FORWARD(p,itf,itf_length);
+
+ // Save offset of permission request
+ reqp = p:
+
+ // Actual Operation will take place after PERM_REQ, skip it
+ p += ALP_ACTION_PERM_REQ_OFFSET;
+
+ // Save action offset
+ actp = p;
+
+ // Actual action
+ ALP_ACTION_F_WR_DATA(p,true,fid,offset,length,data);
+
+ // Add permission request at request offset
+ modem_add_root_permission(
+ reqp,
+ root_key,
+ actp,
+ ALP_ACTION_F_WR_DATA_SIZE(offset,length)
+ );
+
+ SERIAL_SEND(WC_FLOW_ALP_UNS,tmp, (u8)(p-tmp));
+ DEALLOC_BUFFER(tmp);
+}
+
public void modem_enable_urc(u8 type, u8 ifid, u8 val, u8 enable, u8 id)
{
u8 tmp[ALP_ACTION_TAG_SIZE + ALP_ACTION_URCC_SIZE(ALP_URC_TYPE_LQUAL)];