sms: Save/del structures and related values
[libsamsung-ipc.git] / include / sms.h
1 /*
2  * This file is part of libsamsung-ipc.
3  *
4  * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
5  * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
6  *
7  * libsamsung-ipc is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * libsamsung-ipc is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with libsamsung-ipc.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #include <samsung-ipc.h>
23
24 #ifndef __SAMSUNG_IPC_SMS_H__
25 #define __SAMSUNG_IPC_SMS_H__
26
27 /*
28  * Types
29  */
30
31 #define IPC_SMS_SEND_MSG                                        0x0401
32 #define IPC_SMS_INCOMING_MSG                                    0x0402
33 #define IPC_SMS_READ_MSG                                        0x0403
34 #define IPC_SMS_SAVE_MSG                                        0x0404
35 #define IPC_SMS_DEL_MSG                                         0x0405
36 #define IPC_SMS_DELIVER_REPORT                                  0x0406
37 #define IPC_SMS_DEVICE_READY                                    0x0407
38 #define IPC_SMS_SEL_MEM                                         0x0408
39 #define IPC_SMS_STORED_MSG_COUNT                                0x0409
40 #define IPC_SMS_SVC_CENTER_ADDR                                 0x040A
41 #define IPC_SMS_SVC_OPTION                                      0x040B
42 #define IPC_SMS_MEM_STATUS                                      0x040C
43 #define IPC_SMS_CBS_MSG                                         0x040D
44 #define IPC_SMS_CBS_CONFIG                                      0x040E
45 #define IPC_SMS_STORED_MSG_STATUS                               0x040F
46 #define IPC_SMS_PARAM_COUNT                                     0x0410
47 #define IPC_SMS_PARAM                                           0x0411
48
49 /*
50  * Values
51  */
52
53 #define IPC_SMS_ACK_NO_ERROR                                    0x0000
54 #define IPC_SMS_ACK_PDA_FULL_ERROR                              0x8080
55 #define IPC_SMS_ACK_MALFORMED_REQ_ERROR                         0x8061
56 #define IPC_SMS_ACK_UNSPEC_ERROR                                0x806F
57
58 #define IPC_SMS_MSG_MULTIPLE                                    0x01
59 #define IPC_SMS_MSG_SINGLE                                      0x02
60
61 #define IPC_SMS_TYPE_POINT_TO_POINT                             0x01
62 #define IPC_SMS_TYPE_STATUS_REPORT                              0x02
63 #define IPC_SMS_TYPE_OUTGOING                                   0x02
64
65 #define IPC_SMS_STATUS_REC_UNREAD                               0x01
66 #define IPC_SMS_STATUS_REC_READ                                 0x02
67 #define IPC_SMS_STATUS_STO_UNSENT                               0x03
68 #define IPC_SMS_STATUS_STO_SENT                                 0x04
69
70 /*
71  * Structures
72  */
73
74 /*
75  * This is followed by:
76  * smsc_string (variable length, 1st byte is length)
77  * pdu (variable length)
78  */
79 struct ipc_sms_send_msg_request {
80     unsigned char type;
81     unsigned char msg_type;
82     unsigned char unk;
83     unsigned char length;
84     unsigned char smsc_len;
85 } __attribute__((__packed__));
86
87 struct ipc_sms_send_msg_response {
88     unsigned char type;
89     unsigned short error;
90     unsigned char msg_tpid;
91     unsigned char unk;
92 } __attribute__((__packed__));
93
94 struct ipc_sms_incoming_msg {
95     unsigned char msg_type;
96     unsigned char type;
97     unsigned short sim_index;
98     unsigned char msg_tpid;
99     unsigned char length;
100 } __attribute__((__packed__));
101
102 struct ipc_sms_deliver_report_request {
103     unsigned char type;
104     unsigned short error;
105     unsigned char msg_tpid;
106     unsigned char unk;
107 } __attribute__((__packed__));
108
109 struct ipc_sms_deliver_report_response {
110     unsigned short error;
111 } __attribute__((__packed__));
112
113 struct ipc_sms_del_msg_request_data {
114     unsigned char unknown; // This is usually set to 0x02
115     unsigned short index;
116 } __attribute__((__packed__));
117
118 struct ipc_sms_del_msg_response_data {
119     unsigned char unknown; // This is usually set to 0x02
120     unsigned short error;
121     unsigned short index;
122 } __attribute__((__packed__));
123
124 struct ipc_sms_save_msg_request_data {
125     unsigned char unknown; // This is usually set to 0x02
126     unsigned short index; // This is usually set to 0x0B
127     unsigned char status;
128     unsigned char length; // Total SMSC+PDU length
129 } __attribute__((__packed__));
130
131 struct ipc_sms_save_msg_response_data {
132     unsigned char unknown; // This is usually set to 0x02
133     unsigned short error;
134     unsigned short index;
135 } __attribute__((__packed__));
136
137 /*
138  * Helpers
139  */
140
141 unsigned char *ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request *msg,
142     char *smsc, unsigned char *pdu, int length);
143
144 #endif
145
146 // vim:ts=4:sw=4:expandtab