Extract in helpers naming
[libsamsung-ipc.git] / include / misc.h
1 /*
2  * This file is part of libsamsung-ipc.
3  *
4  * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
5  * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
6  * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
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 #include <samsung-ipc.h>
23
24 #ifndef __SAMSUNG_IPC_MISC_H__
25 #define __SAMSUNG_IPC_MISC_H__
26
27 /*
28  * Commands
29  */
30
31 #define IPC_MISC_ME_VERSION                                     0x0A01
32 #define IPC_MISC_ME_IMSI                                        0x0A02
33 #define IPC_MISC_ME_SN                                          0x0A03
34 #define IPC_MISC_TIME_INFO                                      0x0A05
35 #define IPC_MISC_DEBUG_LEVEL                                    0x0A0C
36
37 /*
38  * Values
39  */
40
41 #define IPC_MISC_ME_SN_SERIAL_NUM                               0x01
42 #define IPC_MISC_ME_SN_SERIAL_NUM_SERIAL                        0x04
43 #define IPC_MISC_ME_SN_SERIAL_NUM_MANUFACTURE_DATE              0x05
44 #define IPC_MISC_ME_SN_SERIAL_NUM_BARCODE                       0x06
45
46 /*
47  * Structures
48  */
49
50 struct ipc_misc_me_version_data {
51     unsigned char unknown;
52     char software_version[32];
53     char hardware_version[32];
54     char cal_date[32];
55     char misc[32];
56 } __attribute__((__packed__));
57
58 struct ipc_misc_me_imsi_header {
59     unsigned char length;
60 } __attribute__((__packed__));
61
62 struct ipc_misc_me_sn_data {
63     unsigned char type; // IPC_MISC_ME_SN_SERIAL_NUM
64     unsigned char length;
65     char data[32];
66 } __attribute__((__packed__));
67
68 struct ipc_misc_time_info_data {
69     unsigned char tz_valid, daylight_valid;
70     unsigned char year, mon, day;
71     unsigned char hour, min, sec;
72     signed char tz, dl, dv;
73     char plmn[6];
74 } __attribute__((__packed__));
75
76 /*
77  * Helpers
78  */
79
80 char *ipc_misc_me_imsi_imsi_extract(const void *data, size_t size);
81
82 #endif
83
84 // vim:ts=4:sw=4:expandtab