aboutsummaryrefslogtreecommitdiffstats
path: root/include/sms.h
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-06-25 16:22:19 +0200
committerPaul Kocialkowski <contact@paulk.fr>2013-06-25 16:22:19 +0200
commit9d1137d9197552439af937fee4b9ec5368f562bf (patch)
treeea7fc5e6a73761d414daa9f09eadf05a5937bb89 /include/sms.h
parente207275718352c781c5ddcfdd1015fde36259e9b (diff)
downloadexternal_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.zip
external_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.tar.gz
external_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.tar.bz2
Drop support for the (incomplete) old protocol implementation used on H1.
Also refactor headers: values aligned to 16x4 spaces and other cosmetics Change-Id: I5a6f2c2471599c88c4be74591117d0ab2dfaaddf Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'include/sms.h')
-rw-r--r--include/sms.h121
1 files changed, 87 insertions, 34 deletions
diff --git a/include/sms.h b/include/sms.h
index 9dca3e6..243558d 100644
--- a/include/sms.h
+++ b/include/sms.h
@@ -1,6 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
* Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
*
* libsamsung-ipc is free software: you can redistribute it and/or modify
@@ -18,41 +19,93 @@
*
*/
-#ifndef __SMS_H__
-#define __SMS_H__
+#include <samsung-ipc.h>
-#if defined(DEVICE_IPC_V4)
-#include "device/ipc-v4/sms.h"
-#elif defined(DEVICE_H1)
-#include "device/h1/sms.h"
-#endif
+#ifndef __SAMSUNG_IPC_SMS_H__
+#define __SAMSUNG_IPC_SMS_H__
+
+/*
+ * Types
+ */
+
+#define IPC_SMS_SEND_MSG 0x0401
+#define IPC_SMS_INCOMING_MSG 0x0402
+#define IPC_SMS_READ_MSG 0x0403
+#define IPC_SMS_SAVE_MSG 0x0404
+#define IPC_SMS_DEL_MSG 0x0405
+#define IPC_SMS_DELIVER_REPORT 0x0406
+#define IPC_SMS_DEVICE_READY 0x0407
+#define IPC_SMS_SEL_MEM 0x0408
+#define IPC_SMS_STORED_MSG_COUNT 0x0409
+#define IPC_SMS_SVC_CENTER_ADDR 0x040A
+#define IPC_SMS_SVC_OPTION 0x040B
+#define IPC_SMS_MEM_STATUS 0x040C
+#define IPC_SMS_CBS_MSG 0x040D
+#define IPC_SMS_CBS_CONFIG 0x040E
+#define IPC_SMS_STORED_MSG_STATUS 0x040F
+#define IPC_SMS_PARAM_COUNT 0x0410
+#define IPC_SMS_PARAM 0x0411
+
+/*
+ * Values
+ */
+
+#define IPC_SMS_ACK_NO_ERROR 0x0000
+#define IPC_SMS_ACK_PDA_FULL_ERROR 0x8080
+#define IPC_SMS_ACK_MALFORMED_REQ_ERROR 0x8061
+#define IPC_SMS_ACK_UNSPEC_ERROR 0x806F
+
+#define IPC_SMS_MSG_MULTIPLE 0x01
+#define IPC_SMS_MSG_SINGLE 0x02
+
+#define IPC_SMS_TYPE_POINT_TO_POINT 0x01
+#define IPC_SMS_TYPE_STATUS_REPORT 0x02
+#define IPC_SMS_TYPE_OUTGOING 0x02
+
+/*
+ * Structures
+ */
+
+/*
+ * This is followed by:
+ * smsc_string (variable length, 1st byte is length)
+ * pdu (variable length)
+ */
+struct ipc_sms_send_msg_request {
+ unsigned char type;
+ unsigned char msg_type;
+ unsigned char unk;
+ unsigned char length;
+ unsigned char smsc_len;
+} __attribute__((__packed__));
+
+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__));
-#define IPC_SMS_SEND_MSG 0x0401
-#define IPC_SMS_INCOMING_MSG 0x0402
-#define IPC_SMS_READ_MSG 0x0403
-#define IPC_SMS_SAVE_MSG 0x0404
-#define IPC_SMS_DEL_MSG 0x0405
-#define IPC_SMS_DELIVER_REPORT 0x0406
-#define IPC_SMS_DEVICE_READY 0x0407
-#define IPC_SMS_SEL_MEM 0x0408
-#define IPC_SMS_STORED_MSG_COUNT 0x0409
-#define IPC_SMS_SVC_CENTER_ADDR 0x040A
-#define IPC_SMS_SVC_OPTION 0x040B
-#define IPC_SMS_MEM_STATUS 0x040C
-#define IPC_SMS_CBS_MSG 0x040D
-#define IPC_SMS_CBS_CONFIG 0x040E
-#define IPC_SMS_STORED_MSG_STATUS 0x040F
-#define IPC_SMS_PARAM_COUNT 0x0410
-#define IPC_SMS_PARAM 0x0411
-
-#define IPC_SMS_MSG_MULTIPLE 1
-#define IPC_SMS_MSG_SINGLE 2
-
-#define IPC_SMS_TYPE_POINT_TO_POINT 1
-#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_request *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