111e0ce19cc8f5268748a11cf32e333bc9a6fb1b
[libsamsung-ipc.git] / include / misc.h
1 /*
2  * This file is part of libsamsung-ipc.
3  *
4  * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
5  * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
6  * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
7  *
8  * libsamsung-ipc is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * libsamsung-ipc is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libsamsung-ipc.  If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include <samsung-ipc.h>
24
25 #ifndef __SAMSUNG_IPC_MISC_H__
26 #define __SAMSUNG_IPC_MISC_H__
27
28 /*
29  * Types
30  */
31
32 #define IPC_MISC_ME_VERSION                                     0x0A01
33 #define IPC_MISC_ME_IMSI                                        0x0A02
34 #define IPC_MISC_ME_SN                                          0x0A03
35 #define IPC_MISC_TIME_INFO                                      0x0A05
36 #define IPC_MISC_DEBUG_LEVEL                                    0x0A0C
37
38 /*
39  * Values
40  */
41
42 #define IPC_MISC_ME_SN_SERIAL_NUM                               0x01
43 #define IPC_MISC_ME_SN_SERIAL_NUM_SERIAL                        0x04
44 #define IPC_MISC_ME_SN_SERIAL_NUM_MANUFACTURE_DATE              0x05
45 #define IPC_MISC_ME_SN_SERIAL_NUM_BARCODE                       0x06
46
47 /*
48  * Structures
49  */
50
51 struct ipc_misc_me_version {
52     unsigned char unk;
53     char sw_version[32];
54     char hw_version[32];
55     char cal_date[32];
56     char misc[32];
57 } __attribute__((__packed__));
58
59 struct ipc_misc_me_sn {
60     unsigned char type; // IPC_MISC_ME_SN_SERIAL_NUM*
61     unsigned char length;
62     char data[32];
63 } __attribute__((__packed__));
64
65 struct ipc_misc_time_info {
66     unsigned char tz_valid, daylight_valid;
67     unsigned char year, mon, day;
68     unsigned char hour, min, sec;
69     char tz, dl, dv;
70     char plmn[6];
71 } __attribute__((__packed__));
72
73 /*
74  * Helpers
75  */
76
77 char *ipc_misc_me_imsi_response_get_imsi(struct ipc_message_info *response);
78
79 #endif
80
81 // vim:ts=4:sw=4:expandtab