Hi Andrew,
On 11/07/2010 11:42 AM, Andrzej Zaborowski wrote:
The callback returns the TP-User-Data element content of the RP-ACK
or
RP-ERROR message, returned by the UICC.
---
src/ofono.h | 8 ++++++++
src/stk.c | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 0 deletions(-)
+int __ofono_sms_sim_download(struct ofono_stk *stk, const struct sms *msg,
+ __ofono_sms_sim_download_cb_t cb, void *data)
+{
+ struct stk_envelope e;
+
+ if (msg->type != SMS_TYPE_DELIVER)
+ return -EINVAL;
+
+ DBG("");
+
+ memset(&e, 0, sizeof(e));
+
+ e.type = STK_ENVELOPE_TYPE_SMS_PP_DOWNLOAD;
+ e.src = STK_DEVICE_IDENTITY_TYPE_NETWORK;
+
+ e.sms_pp_download.address.number = (char *) msg->sc_addr.address;
+ e.sms_pp_download.address.ton_npi = msg->sc_addr.numbering_plan |
+ (msg->sc_addr.number_type << 4);
+ memcpy(&e.sms_pp_download.message, &msg->deliver, sizeof(msg->deliver));
+
+ stk->sms_pp_cb = cb;
+ stk->sms_pp_userdata = data;
Please note that this has a possibility of overwriting the sms_pp_cb and
sms_pp_userdata if multiple SMS-PP sms messages are received (and
acknowledged) in short succession.
However, I assume you already thought of this and will take care of it
with the async ack task.
Patch has been applied, thanks.
Regards,
-Denis