OFono_Sent_SMS_Cb cb;
OFono_Modem *modem;
const void *data;
+ const char *destination;
+ const char *message;
} OFono_Sent_SMS_Cb_Context;
struct _OFono_Sent_SMS
OFono_Bus_Object base;
OFono_Sent_SMS_State state;
OFono_Sent_SMS_Cb_Context *pending_send;
+ const char *destination;
+ const char *message;
+ time_t timestamp;
};
struct _OFono_Modem
static void _sent_sms_free(OFono_Sent_SMS *sms)
{
DBG("sms=%p %s", sms, sms->base.path);
+ eina_stringshare_del(sms->destination);
+ eina_stringshare_del(sms->message);
_bus_object_free(&sms->base);
}
OFono_Sent_SMS_Cb_Context *ctx = sms->pending_send;
if (ctx->cb)
ctx->cb((void *)ctx->data, OFONO_ERROR_NONE, sms);
+ sms->destination = ctx->destination;
+ sms->message = ctx->message;
+ sms->timestamp = time(NULL);
free(ctx);
sms->pending_send = NULL;
}
return sms->state;
}
+const char *ofono_sent_sms_destination_get(const OFono_Sent_SMS *sms)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sms, NULL);
+ return sms->destination;
+}
+
+const char *ofono_sent_sms_message_get(const OFono_Sent_SMS *sms)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sms, NULL);
+ return sms->message;
+}
+
+time_t ofono_sent_sms_timestamp_get(const OFono_Sent_SMS *sms)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sms, 0);
+ return sms->timestamp;
+}
+
OFono_Pending *ofono_sent_sms_cancel(OFono_Sent_SMS *sms, OFono_Simple_Cb cb,
const void *data)
{
if (ctx->cb)
ctx->cb((void *)ctx->data, oe, sms);
+ eina_stringshare_del(ctx->destination);
+ eina_stringshare_del(ctx->message);
free(ctx);
}
ctx->cb = cb;
ctx->data = data;
ctx->modem = m;
+ ctx->destination = eina_stringshare_add(number);
+ ctx->message = eina_stringshare_add(message);
msg = dbus_message_new_method_call(
bus_id, m->base.path, OFONO_PREFIX OFONO_MSG_IFACE,
error:
if (cb)
cb((void *)data, err, NULL);
+ eina_stringshare_del(ctx->destination);
+ eina_stringshare_del(ctx->message);
free(ctx);
return NULL;
}
OFono_Sent_SMS_Cb cb, const void *data);
OFono_Sent_SMS_State ofono_sent_sms_state_get(const OFono_Sent_SMS *sms);
+const char *ofono_sent_sms_destination_get(const OFono_Sent_SMS *sms);
+const char *ofono_sent_sms_message_get(const OFono_Sent_SMS *sms);
+time_t ofono_sent_sms_timestamp_get(const OFono_Sent_SMS *sms);
+
OFono_Pending *ofono_sent_sms_cancel(OFono_Sent_SMS *sms, OFono_Simple_Cb cb, const void *data);
OFono_Callback_List_Sent_SMS_Node *ofono_sent_sms_changed_cb_add(OFono_Sent_SMS_Cb cb,