diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-11-01 19:13:02 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-11-01 19:14:27 +0100 |
commit | f722771a3837793c397d1db5075b8e8bd2906fed (patch) | |
tree | 3af17bae24b429dfb603c937cef85b29d6955f2c | |
parent | 3b804a8dc0352281b95b2506b0e35114a37fe843 (diff) | |
download | external_libsamsung-ipc-f722771a3837793c397d1db5075b8e8bd2906fed.zip external_libsamsung-ipc-f722771a3837793c397d1db5075b8e8bd2906fed.tar.gz external_libsamsung-ipc-f722771a3837793c397d1db5075b8e8bd2906fed.tar.bz2 |
SMS: Renamed structures according to messages names, build sms.c
Change-Id: I9e8d01ca8b0eb23d9ca2a2034c5bb9594f151e92
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | include/device/ipc-v4/sms.h | 31 | ||||
-rw-r--r-- | include/sms.h | 2 | ||||
-rw-r--r-- | samsung-ipc/Makefile.am | 1 | ||||
-rw-r--r-- | samsung-ipc/sms.c | 8 |
5 files changed, 28 insertions, 15 deletions
@@ -55,6 +55,7 @@ samsung-ipc_files := \ samsung-ipc/misc.c \ samsung-ipc/net.c \ samsung-ipc/sec.c \ + samsung-ipc/sms.c \ samsung-ipc/wakelock.c \ samsung-ipc/device/h1/h1_ipc.c \ samsung-ipc/device/crespo/crespo_ipc.c \ diff --git a/include/device/ipc-v4/sms.h b/include/device/ipc-v4/sms.h index 6d5b62b..1122660 100644 --- a/include/device/ipc-v4/sms.h +++ b/include/device/ipc-v4/sms.h @@ -26,20 +26,12 @@ #define IPC_SMS_ACK_MALFORMED_REQ_ERROR 0x8061 #define IPC_SMS_ACK_UNSPEC_ERROR 0x806F -struct ipc_sms_incoming_msg { - unsigned char msg_type; - unsigned char type; - unsigned short sim_index; - unsigned char msg_tpid; - unsigned char length; -} __attribute__((__packed__)); - /* * This is followed by: * smsc_string (variable length, 1st byte is length) * pdu (variable length) */ -struct ipc_sms_send_msg { +struct ipc_sms_send_msg_request { unsigned char type; unsigned char msg_type; unsigned char unk; @@ -47,13 +39,32 @@ struct ipc_sms_send_msg { unsigned char smsc_len; } __attribute__((__packed__)); -struct ipc_sms_deliv_report_msg { +struct ipc_sms_send_msg_response { unsigned char type; unsigned short error; unsigned char msg_tpid; unsigned char unk; } __attribute__((__packed__)); +struct ipc_sms_incoming_msg { + unsigned char msg_type; + unsigned char type; + unsigned short sim_index; + unsigned char msg_tpid; + unsigned char length; +} __attribute__((__packed__)); + +struct ipc_sms_deliver_report_request { + unsigned char type; + unsigned short error; + unsigned char msg_tpid; + unsigned char unk; +} __attribute__((__packed__)); + +struct ipc_sms_deliver_report_response { + unsigned short error; +} __attribute__((__packed__)); + #endif // vim:ts=4:sw=4:expandtab diff --git a/include/sms.h b/include/sms.h index 24177f2..9dca3e6 100644 --- a/include/sms.h +++ b/include/sms.h @@ -52,7 +52,7 @@ #define IPC_SMS_TYPE_STATUS_REPORT 2 #define IPC_SMS_TYPE_OUTGOING 2 -unsigned char* ipc_sms_send_msg_pack(struct ipc_sms_send_msg *msg, char *smsc, unsigned char *pdu, int length); +unsigned char* ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request *msg, char *smsc, unsigned char *pdu, int length); #endif diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am index 6f7c380..b9022dd 100644 --- a/samsung-ipc/Makefile.am +++ b/samsung-ipc/Makefile.am @@ -22,6 +22,7 @@ libsamsung_ipc_la_SOURCES = \ rfs.c \ misc.c \ sec.c \ + sms.c \ gen.c \ gprs.c \ call.c \ diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c index 58eba72..10fbf26 100644 --- a/samsung-ipc/sms.c +++ b/samsung-ipc/sms.c @@ -22,7 +22,7 @@ #include <string.h> #include <assert.h> -unsigned char* ipc_sms_send_msg_pack(struct ipc_sms_send_msg *msg, char *smsc, +unsigned char* ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request *msg, char *smsc, unsigned char *pdu, int pdu_length) { unsigned char *data = NULL, *p = NULL; @@ -32,13 +32,13 @@ unsigned char* ipc_sms_send_msg_pack(struct ipc_sms_send_msg *msg, char *smsc, assert(pdu != NULL); smsc_len = strlen(smsc); - data_length = smsc_len + pdu_length + sizeof(struct ipc_sms_send_msg); + data_length = smsc_len + pdu_length + sizeof(struct ipc_sms_send_msg_request); data = (unsigned char*) malloc(sizeof(unsigned char) * data_length); memset(data, 0, data_length); p = data; - memcpy(p, &msg, sizeof(struct ipc_sms_send_msg)); - p += sizeof(struct ipc_sms_send_msg); + memcpy(p, &msg, sizeof(struct ipc_sms_send_msg_request)); + p += sizeof(struct ipc_sms_send_msg_request); memcpy(p, (char*) (smsc + 1), smsc_len); p += smsc_len; memcpy(p, pdu, pdu_length); |