summaryrefslogtreecommitdiffstats
path: root/sms.c
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2011-12-29 13:32:26 +0100
committerPaulK <contact@paulk.fr>2011-12-29 13:32:26 +0100
commit16fd5fb67ba755fa65253eaaf861f46dc1135147 (patch)
tree08e47d251aad8f430530beeb082ceb2a89387157 /sms.c
parent0091ceae5f7cbeeb42e3b43de3dcf8e500fe8752 (diff)
downloadhardware_ril_samsung-ril-16fd5fb67ba755fa65253eaaf861f46dc1135147.zip
hardware_ril_samsung-ril-16fd5fb67ba755fa65253eaaf861f46dc1135147.tar.gz
hardware_ril_samsung-ril-16fd5fb67ba755fa65253eaaf861f46dc1135147.tar.bz2
Added preliminary RFS support, code cleanup, completed TODO list
Diffstat (limited to 'sms.c')
-rw-r--r--sms.c56
1 files changed, 30 insertions, 26 deletions
diff --git a/sms.c b/sms.c
index 9c0cf90..4b07de0 100644
--- a/sms.c
+++ b/sms.c
@@ -25,6 +25,34 @@
#include "samsung-ril.h"
#include "util.h"
+/**
+ * Format conversion utils
+ */
+
+unsigned short ril2ipc_sms_ack_error(int success, int failcause)
+{
+ if(success) {
+ return IPC_SMS_ACK_NO_ERROR;
+ } else {
+ switch(failcause) {
+ case 0xD3:
+ return IPC_SMS_ACK_PDA_FULL_ERROR;
+ default:
+ return IPC_SMS_ACK_UNSPEC_ERROR;
+ }
+ }
+}
+
+RIL_Errno ipc2ril_sms_ack_error(unsigned short error)
+{
+ switch(error) {
+ case IPC_SMS_ACK_NO_ERROR:
+ return RIL_E_SUCCESS;
+ default:
+ return RIL_E_GENERIC_FAILURE;
+ }
+}
+
void ipc_sms_incoming_msg(struct ipc_message_info *info)
{
struct ipc_sms_incoming_msg *msg = (struct ipc_sms_incoming_msg *) info->data;
@@ -56,30 +84,6 @@ exit:
free(resp);
}
-unsigned short sms_ack_error_ril2ipc(int success, int failcause)
-{
- if(success) {
- return IPC_SMS_ACK_NO_ERROR;
- } else {
- switch(failcause) {
- case 0xD3:
- return IPC_SMS_ACK_PDA_FULL_ERROR;
- default:
- return IPC_SMS_ACK_UNSPEC_ERROR;
- }
- }
-}
-
-RIL_Errno sms_ack_error_ipc2ril(unsigned short error)
-{
- switch(error) {
- case IPC_SMS_ACK_NO_ERROR:
- return RIL_E_SUCCESS;
- default:
- return RIL_E_GENERIC_FAILURE;
- }
-}
-
/**
* In: RIL_REQUEST_SMS_ACKNOWLEDGE
* Acknowledge successful or failed receipt of SMS previously indicated
@@ -100,7 +104,7 @@ void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t datalen)
}
report_msg.type = IPC_SMS_TYPE_STATUS_REPORT;
- report_msg.error = sms_ack_error_ril2ipc(success, failcause);
+ report_msg.error = ril2ipc_sms_ack_error(success, failcause);
report_msg.msg_tpid = ril_state.msg_tpid_lock;
report_msg.unk = 0;
@@ -224,7 +228,7 @@ void ipc_sms_send_msg(struct ipc_message_info *info)
LOGD("RECV ack for msg_tpid %d\n", report_msg->msg_tpid);
- ril_ack_err = sms_ack_error_ipc2ril(report_msg->error);
+ ril_ack_err = ipc2ril_sms_ack_error(report_msg->error);
ril_state.tokens.send_sms = 0;