summaryrefslogtreecommitdiffstats
path: root/src/sms.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-09-20 14:02:34 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-09-21 08:44:47 -0500
commit016f168f476b6469030059c4d6c1159d75cb4cb5 (patch)
treeb6f2d0940c8658e811de0dcacb2ab141c8e4b8cd /src/sms.c
parent63c8b720fe0bded10d77e9359f9e56be5267cc75 (diff)
downloadofono-016f168f476b6469030059c4d6c1159d75cb4cb5.tar.bz2
sms: Refactor __ofono_sms_txq_submit
Diffstat (limited to 'src/sms.c')
-rw-r--r--src/sms.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/sms.c b/src/sms.c
index 5ecebd38..5ee031cf 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -1457,18 +1457,27 @@ void *ofono_sms_get_data(struct ofono_sms *sms)
return sms->driver_data;
}
-unsigned int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list,
- unsigned int flags,
- ofono_sms_txq_submit_cb_t cb,
- void *data, ofono_destroy_func destroy)
+int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list,
+ unsigned int flags,
+ struct ofono_uuid *uuid,
+ ofono_sms_txq_submit_cb_t cb,
+ void *data, ofono_destroy_func destroy)
{
- struct tx_queue_entry *entry = tx_queue_entry_new(list);
+ struct tx_queue_entry *entry;
+ entry = tx_queue_entry_new(list, flags, cb, data, destroy);
+ if (entry == NULL)
+ return -ENOMEM;
g_queue_push_tail(sms->txq, entry);
if (g_queue_get_length(sms->txq) == 1)
sms->tx_source = g_timeout_add(0, tx_next, sms);
- return entry->msg_id;
+ if (uuid)
+ memcpy(uuid, &entry->uuid, sizeof(*uuid));
+
+ /* TODO: If this is exported via D-Bus, signal MessageAdded */
+
+ return 0;
}