aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
parente207275718352c781c5ddcfdd1015fde36259e9b (diff)
downloadhardware_replicant_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.tar.gz
hardware_replicant_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.tar.bz2
hardware_replicant_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.zip
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')
-rw-r--r--include/Makefile.am19
-rw-r--r--include/call.h151
-rw-r--r--include/device/h1/call.h59
-rw-r--r--include/device/h1/disp.h30
-rw-r--r--include/device/h1/gen.h34
-rw-r--r--include/device/h1/misc.h38
-rw-r--r--include/device/h1/net.h41
-rw-r--r--include/device/h1/sms.h40
-rw-r--r--include/device/ipc-v4/call.h64
-rw-r--r--include/device/ipc-v4/disp.h31
-rw-r--r--include/device/ipc-v4/gen.h34
-rw-r--r--include/device/ipc-v4/misc.h40
-rw-r--r--include/device/ipc-v4/net.h43
-rw-r--r--include/device/ipc-v4/sms.h70
-rw-r--r--include/disp.h34
-rw-r--r--include/gen.h34
-rw-r--r--include/gprs.h121
-rw-r--r--include/misc.h64
-rw-r--r--include/net.h114
-rw-r--r--include/pwr.h43
-rw-r--r--include/radio.h4
-rw-r--r--include/rfs.h49
-rw-r--r--include/samsung-ipc.h6
-rw-r--r--include/sec.h138
-rw-r--r--include/sms.h121
-rw-r--r--include/snd.h68
-rw-r--r--include/ss.h22
-rw-r--r--include/wakelock.h8
28 files changed, 618 insertions, 902 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 09fecf8..62dbbc8 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -19,22 +19,3 @@ samsung_ipcinclude_HEADERS = \
wakelock.h \
samsung-ipc.h \
$(NULL)
-
-samsung_ipc_v4includedir = $(includedir)/samsung-ipc-1.0/device/ipc-v4/
-samsung_ipc_v4include_HEADERS = \
- device/ipc-v4/call.h \
- device/ipc-v4/net.h \
- device/ipc-v4/sms.h \
- device/ipc-v4/misc.h \
- device/ipc-v4/gen.h \
- device/ipc-v4/disp.h \
- $(NULL)
-
-samsung_ipc_h1includedir = $(includedir)/samsung-ipc-1.0/device/h1/
-samsung_ipc_h1include_HEADERS = \
- device/h1/net.h \
- device/h1/sms.h \
- device/h1/misc.h \
- device/h1/gen.h \
- device/h1/call.h \
- $(NULL)
diff --git a/include/call.h b/include/call.h
index 1ceb57b..8e981ea 100644
--- a/include/call.h
+++ b/include/call.h
@@ -1,6 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 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,76 +19,118 @@
*
*/
-#ifndef __CALL_H__
-#define __CALL_H__
+#include <samsung-ipc.h>
-#if defined(DEVICE_IPC_V4)
-#include "device/ipc-v4/call.h"
-#elif defined(DEVICE_H1)
-#include "device/h1/call.h"
-#endif
+#ifndef __SAMSUNG_IPC_CALL_H__
+#define __SAMSUNG_IPC_CALL_H__
-/* Message types */
-#define IPC_CALL_OUTGOING 0x0201
-#define IPC_CALL_INCOMING 0x0202
-#define IPC_CALL_RELEASE 0x0203
-#define IPC_CALL_ANSWER 0x0204
-#define IPC_CALL_STATUS 0x0205
-#define IPC_CALL_LIST 0x0206
-#define IPC_CALL_BURST_DTMF 0x0207
-#define IPC_CALL_CONT_DTMF 0x0208
-#define IPC_CALL_WAITING 0x0209
-#define IPC_CALL_LINE_ID 0x020A
-
-/* Enum values */
-#define IPC_CALL_TYPE_VOICE 0x01
-#define IPC_CALL_TYPE_DATA 0x03
-
-#define IPC_CALL_IDENTITY_DEFAULT 0x00
-#define IPC_CALL_IDENTITY_HIDE 0x01
-#define IPC_CALL_IDENTITY_SHOW 0x02
-
-#define IPC_CALL_PREFIX_NONE 0x00
-#define IPC_CALL_PREFIX_INTL 0x11
+/*
+ * Types
+ */
-/* Only for ipc_call_status, NOT call_list */
-#define IPC_CALL_STATE_DIALING 0x01
-#define IPC_CALL_STATE_IGNORING_INCOMING_STATUS 0x02
-#define IPC_CALL_STATE_CONNECTED 0x03
-#define IPC_CALL_STATE_RELEASED 0x04
-#define IPC_CALL_STATE_CONNECTING 0x05
+#define IPC_CALL_OUTGOING 0x0201
+#define IPC_CALL_INCOMING 0x0202
+#define IPC_CALL_RELEASE 0x0203
+#define IPC_CALL_ANSWER 0x0204
+#define IPC_CALL_STATUS 0x0205
+#define IPC_CALL_LIST 0x0206
+#define IPC_CALL_BURST_DTMF 0x0207
+#define IPC_CALL_CONT_DTMF 0x0208
+#define IPC_CALL_WAITING 0x0209
+#define IPC_CALL_LINE_ID 0x020A
+
+/*
+ * Values
+ */
-#define IPC_CALL_LIST_ENTRY_STATE_ACTIVE 0x01
-#define IPC_CALL_LIST_ENTRY_STATE_HOLDING 0x02
-#define IPC_CALL_LIST_ENTRY_STATE_DIALING 0x03
-#define IPC_CALL_LIST_ENTRY_STATE_ALERTING 0x04
-#define IPC_CALL_LIST_ENTRY_STATE_INCOMING 0x05
-#define IPC_CALL_LIST_ENTRY_STATE_WAITING 0x06
+#define IPC_CALL_TYPE_VOICE 0x01
+#define IPC_CALL_TYPE_DATA 0x03
-#define IPC_CALL_END_CAUSE_NORMAL 0x05
-#define IPC_CALL_END_CAUSE_REJECTED 0x2F
-#define IPC_CALL_END_CAUSE_UNSPECIFIED 0x10
+#define IPC_CALL_IDENTITY_DEFAULT 0x00
+#define IPC_CALL_IDENTITY_HIDE 0x01
+#define IPC_CALL_IDENTITY_SHOW 0x02
-#define IPC_CALL_TERM_MO 0x01
-#define IPC_CALL_TERM_MT 0x02
+#define IPC_CALL_PREFIX_NONE 0x00
+#define IPC_CALL_PREFIX_INTL 0x11
-#define IPC_CALL_DTMF_STATE_START 0x01
-#define IPC_CALL_DTMF_STATE_STOP 0x02
+/* Only for ipc_call_status, NOT call_list */
+#define IPC_CALL_STATE_DIALING 0x01
+#define IPC_CALL_STATE_IGNORING_INCOMING_STATUS 0x02
+#define IPC_CALL_STATE_CONNECTED 0x03
+#define IPC_CALL_STATE_RELEASED 0x04
+#define IPC_CALL_STATE_CONNECTING 0x05
+
+#define IPC_CALL_LIST_ENTRY_STATE_ACTIVE 0x01
+#define IPC_CALL_LIST_ENTRY_STATE_HOLDING 0x02
+#define IPC_CALL_LIST_ENTRY_STATE_DIALING 0x03
+#define IPC_CALL_LIST_ENTRY_STATE_ALERTING 0x04
+#define IPC_CALL_LIST_ENTRY_STATE_INCOMING 0x05
+#define IPC_CALL_LIST_ENTRY_STATE_WAITING 0x06
+
+#define IPC_CALL_END_CAUSE_NORMAL 0x05
+#define IPC_CALL_END_CAUSE_REJECTED 0x2F
+#define IPC_CALL_END_CAUSE_UNSPECIFIED 0x10
+
+#define IPC_CALL_TERM_MO 0x01
+#define IPC_CALL_TERM_MT 0x02
+
+#define IPC_CALL_DTMF_STATE_START 0x01
+#define IPC_CALL_DTMF_STATE_STOP 0x02
+
+/*
+ * Structures
+ */
-struct ipc_message_info;
+struct ipc_call_incoming {
+ unsigned char unk;
+ unsigned char type; // IPC_CALL_TYPE_...
+ unsigned char id;
+ unsigned char line;
+} __attribute__((__packed__));
+
+struct ipc_call_outgoing {
+ unsigned char unk;
+ unsigned char type; // IPC_CALL_TYPE_...
+ unsigned char identity; // IPC_CALL_IDENTITY_...
+ unsigned char length;
+ unsigned char prefix; // IPC_CALL_PREFIX_...
+ unsigned char number[86];
+} __attribute__((__packed__));
+
+struct ipc_call_status {
+ unsigned char unk;
+ unsigned char type;
+ unsigned char id;
+ unsigned char state;
+ unsigned char reason;
+ unsigned char end_cause;
+} __attribute__((__packed__));
+
+struct ipc_call_list_entry {
+ unsigned char unk0;
+ unsigned char type; // IPC_CALL_TYPE_...
+ unsigned char idx;
+ unsigned char term; // IPC_CALL_TERM_...
+ unsigned char state; // IPC_CALL_LIST_ENTRY_STATE_...
+ unsigned char mpty;
+ unsigned char number_len;
+ unsigned char unk4;
+} __attribute__((__packed__));
struct ipc_call_cont_dtmf {
unsigned char state;
unsigned char tone;
} __attribute__((__packed__));
-void ipc_call_outgoing_setup(struct ipc_call_outgoing *message, unsigned char type,
- unsigned char identity, unsigned char prefix, char *number);
+/*
+ * Helpers
+ */
+void ipc_call_outgoing_setup(struct ipc_call_outgoing *message, unsigned char type, unsigned char identity, unsigned char prefix, char *number);
unsigned int ipc_call_list_response_get_num_entries(struct ipc_message_info *response);
struct ipc_call_list_entry* ipc_call_list_response_get_entry(struct ipc_message_info *response, unsigned int num);
-char* ipc_call_list_response_get_entry_number(struct ipc_message_info *response, unsigned int num);
-unsigned char* ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf *message, unsigned char *burst, int burst_len);
+char *ipc_call_list_response_get_entry_number(struct ipc_message_info *response, unsigned int num);
+unsigned char *ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf *message, unsigned char *burst, int burst_len);
#endif
diff --git a/include/device/h1/call.h b/include/device/h1/call.h
deleted file mode 100644
index 43a1928..0000000
--- a/include/device/h1/call.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_H1_CALL_H__
-#define __DEVICE_H1_CALL_H__
-
-struct ipc_call_incoming {
- unsigned char type; // IPC_CALL_TYPE_...
- unsigned char id;
- unsigned char line;
-} __attribute__((__packed__));
-
-struct ipc_call_outgoing {
- unsigned char type; // IPC_CALL_TYPE_...
- unsigned char identity; // IPC_CALL_IDENTITY_...
- unsigned char length;
- unsigned char prefix; // IPC_CALL_PREFIX_...
- unsigned char number[86];
-} __attribute__((__packed__));
-
-struct ipc_call_status {
- unsigned char type;
- unsigned char id;
- unsigned char state;
- unsigned char reason;
- unsigned char end_cause;
-} __attribute__((__packed__));
-
-struct ipc_call_list_entry {
- unsigned char type; // IPC_CALL_TYPE_...
- unsigned char idx;
- unsigned char term; // IPC_CALL_TERM_...
- unsigned char state; // IPC_CALL_LIST_ENTRY_STATE_...
- unsigned char mpty;
- unsigned char number_len;
- unsigned char unk4;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/h1/disp.h b/include/device/h1/disp.h
deleted file mode 100644
index 2f0c15c..0000000
--- a/include/device/h1/disp.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_H1_DISP_H__
-#define __DEVICE_H1_DISP_H__
-
-struct ipc_disp_icon_info {
- unsigned char unk, rssi, battery, act, reg;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/h1/gen.h b/include/device/h1/gen.h
deleted file mode 100644
index b3ddb5c..0000000
--- a/include/device/h1/gen.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_H1_GEN_H__
-#define __DEVICE_H1_GEN_H__
-
-struct ipc_gen_phone_res {
- unsigned char group;
- unsigned char index;
- unsigned short code;
- unsigned char unk;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/h1/misc.h b/include/device/h1/misc.h
deleted file mode 100644
index 179e7b3..0000000
--- a/include/device/h1/misc.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_H1_MISC_H__
-#define __DEVICE_H1_MISC_H__
-
-struct ipc_misc_me_version {
- char sw_version[32];
- char hw_version[32];
- char cal_date[32];
- char misc[32];
-} __attribute__((__packed__));
-
-struct ipc_misc_me_sn {
- unsigned char length;
- char imei[32];
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/h1/net.h b/include/device/h1/net.h
deleted file mode 100644
index 8f3c449..0000000
--- a/include/device/h1/net.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_H1_NET_H__
-#define __DEVICE_H1_NET_H__
-
-#define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x01
-#define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x02
-#define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x03
-#define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x04
-#define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x05
-
-struct ipc_net_current_plmn {
- char unk0;
- unsigned char slevel;
- unsigned char plmn[6];
- unsigned char type;
- unsigned short lac;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/h1/sms.h b/include/device/h1/sms.h
deleted file mode 100644
index bb305d5..0000000
--- a/include/device/h1/sms.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_H1_SMS_H__
-#define __DEVICE_H1_SMS_H__
-
-#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
-
-struct ipc_sms_incoming_msg {
- unsigned char type, unk, length;
-} __attribute__((__packed__));
-
-struct ipc_sms_send_msg {
- unsigned char hint, length;
-} __attribute__((__packed__));
-
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/ipc-v4/call.h b/include/device/ipc-v4/call.h
deleted file mode 100644
index 15e9039..0000000
--- a/include/device/ipc-v4/call.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_IPC_V4_CALL_H__
-#define __DEVICE_IPC_V4_CALL_H__
-
-struct ipc_call_incoming {
- unsigned char unk;
- unsigned char type; // IPC_CALL_TYPE_...
- unsigned char id;
- unsigned char line;
-} __attribute__((__packed__));
-
-struct ipc_call_outgoing {
- unsigned char unk;
- unsigned char type; // IPC_CALL_TYPE_...
- unsigned char identity; // IPC_CALL_IDENTITY_...
- unsigned char length;
- unsigned char prefix; // IPC_CALL_PREFIX_...
- unsigned char number[86];
-} __attribute__((__packed__));
-
-struct ipc_call_status {
- unsigned char unk;
- unsigned char type;
- unsigned char id;
- unsigned char state;
- unsigned char reason;
- unsigned char end_cause;
-} __attribute__((__packed__));
-
-struct ipc_call_list_entry {
- unsigned char unk0;
- unsigned char type; // IPC_CALL_TYPE_...
- unsigned char idx;
- unsigned char term; // IPC_CALL_TERM_...
- unsigned char state; // IPC_CALL_LIST_ENTRY_STATE_...
- unsigned char mpty;
- unsigned char number_len;
- unsigned char unk4;
-} __attribute__((__packed__));
-
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/ipc-v4/disp.h b/include/device/ipc-v4/disp.h
deleted file mode 100644
index 560362b..0000000
--- a/include/device/ipc-v4/disp.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2012 Paul Kocialkowski <contact@paulk.fr>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_IPC_V4_DISP_H__
-#define __DEVICE_IPC_V4_DISP_H__
-
-struct ipc_disp_icon_info {
- unsigned char rssi, bars, act, reg;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/ipc-v4/gen.h b/include/device/ipc-v4/gen.h
deleted file mode 100644
index ff75a48..0000000
--- a/include/device/ipc-v4/gen.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_IPC_V4_GEN_H__
-#define __DEVICE_IPC_V4_GEN_H__
-
-struct ipc_gen_phone_res {
- unsigned char group;
- unsigned char index;
- unsigned char type;
- unsigned short code;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/ipc-v4/misc.h b/include/device/ipc-v4/misc.h
deleted file mode 100644
index 0c96ad1..0000000
--- a/include/device/ipc-v4/misc.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_IPC_V4_MISC_H__
-#define __DEVICE_IPC_V4_MISC_H__
-
-struct ipc_misc_me_version {
- unsigned char unk;
- char sw_version[32];
- char hw_version[32];
- char cal_date[32];
- char misc[32];
-} __attribute__((__packed__));
-
-struct ipc_misc_me_sn {
- unsigned char type; // IPC_MISC_ME_SN_SERIAL_NUM*
- unsigned char length;
- char data[32];
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/ipc-v4/net.h b/include/device/ipc-v4/net.h
deleted file mode 100644
index 8862fd2..0000000
--- a/include/device/ipc-v4/net.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_IPC_V4_NET_H__
-#define __DEVICE_IPC_V4_NET_H__
-
-#define IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN 0xff
-#define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x00
-#define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x01
-#define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x02
-#define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x03
-#define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x04
-
-struct ipc_net_current_plmn_response {
- char unk0;
- unsigned char slevel;
- char unk1;
- char plmn[5];
- unsigned char type; // IPC_NET_SERVICE_TYPE_... ?
- unsigned short lac;
-} __attribute__((__packed__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/device/ipc-v4/sms.h b/include/device/ipc-v4/sms.h
deleted file mode 100644
index 1122660..0000000
--- a/include/device/ipc-v4/sms.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * This file is part of libsamsung-ipc.
- *
- * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
- *
- * libsamsung-ipc is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * libsamsung-ipc is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef __DEVICE_IPC_V4_SMS_H__
-#define __DEVICE_IPC_V4_SMS_H__
-
-#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
-
-/*
- * 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__));
-
-#endif
-
-// vim:ts=4:sw=4:expandtab
diff --git a/include/disp.h b/include/disp.h
index 09c60c5..089031d 100644
--- a/include/disp.h
+++ b/include/disp.h
@@ -1,6 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 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,18 +19,29 @@
*
*/
-#ifndef __DISP_H__
-#define __DISP_H__
+#include <samsung-ipc.h>
-#if defined(DEVICE_IPC_V4)
-#include "device/ipc-v4/disp.h"
-#elif defined(DEVICE_H1)
-#include "device/h1/disp.h"
-#endif
+#ifndef __SAMSUNG_IPC_DISP_H__
+#define __SAMSUNG_IPC_DISP_H__
+
+/*
+ * Types
+ */
+
+#define IPC_DISP_ICON_INFO 0x0701
+#define IPC_DISP_HOMEZONE_INFO 0x0702
+#define IPC_DISP_RSSI_INFO 0x0706
-#define IPC_DISP_ICON_INFO 0x0701
-#define IPC_DISP_HOMEZONE_INFO 0x0702
-#define IPC_DISP_RSSI_INFO 0x0706
+/*
+ * Structures
+ */
+
+struct ipc_disp_icon_info {
+ unsigned char rssi;
+ unsigned char bars;
+ unsigned char act;
+ unsigned char reg;
+} __attribute__((__packed__));
struct ipc_disp_rssi_info {
unsigned char rssi;
diff --git a/include/gen.h b/include/gen.h
index f707151..7f2fe6d 100644
--- a/include/gen.h
+++ b/include/gen.h
@@ -1,6 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 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,16 +19,31 @@
*
*/
-#ifndef __GEN_H__
-#define __GEN_H__
+#include <samsung-ipc.h>
-#if defined(DEVICE_IPC_V4)
-#include "device/ipc-v4/gen.h"
-#elif defined(DEVICE_H1)
-#include "device/h1/gen.h"
-#endif
+#ifndef __SAMSUNG_IPC_GEN_H__
+#define __SAMSUNG_IPC_GEN_H__
+
+/*
+ * Types
+ */
+
+#define IPC_GEN_PHONE_RES 0x8001
-#define IPC_GEN_PHONE_RES 0x8001
+/*
+ * Structures
+ */
+
+struct ipc_gen_phone_res {
+ unsigned char group;
+ unsigned char index;
+ unsigned char type;
+ unsigned short code;
+} __attribute__((__packed__));
+
+/*
+ * Helpers
+ */
int ipc_gen_phone_res_check(struct ipc_gen_phone_res *res);
diff --git a/include/gprs.h b/include/gprs.h
index 09da61d..f3f5fc1 100644
--- a/include/gprs.h
+++ b/include/gprs.h
@@ -1,6 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
* Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
*
* libsamsung-ipc is free software: you can redistribute it and/or modify
@@ -18,50 +19,64 @@
*
*/
-#ifndef __GPRS_H__
-#define __GPRS_H__
-
-#define IPC_GPRS_DEFINE_PDP_CONTEXT 0x0D01
-#define IPC_GPRS_QOS 0x0D02
-#define IPC_GPRS_PS 0x0D03
-#define IPC_GPRS_PDP_CONTEXT 0x0D04
-#define IPC_GPRS_ENTER_DATA 0x0D05
-#define IPC_GPRS_SHOW_PDP_ADDR 0x0D06
-#define IPC_GPRS_MS_CLASS 0x0D07
-#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D08
-#define IPC_GPRS_IP_CONFIGURATION 0x0D09
-#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D0A
-#define IPC_GPRS_TFT 0x0D0B
-#define IPC_GPRS_HSDPA_STATUS 0x0D0C
-#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0D
-#define IPC_GPRS_DATA_DORMANT 0x0D0E
-#define IPC_GPRS_DUN_PIN_CTRL 0x0D0F
-#define IPC_GPRS_CALL_STATUS 0x0D10
-#define IPC_GPRS_PORT_LIST 0x0D11
-
-#define IPC_GPRS_STATE_NOT_ENABLED 0x00
-#define IPC_GPRS_STATE_ENABLED 0x01
-#define IPC_GPRS_STATE_DISABLED 0x03
-
-#define IPC_GPRS_FAIL_INSUFFICIENT_RESOURCES 0x0004
-#define IPC_GPRS_FAIL_MISSING_UKNOWN_APN 0x0005
-#define IPC_GPRS_FAIL_UNKNOWN_PDP_ADDRESS_TYPE 0x0006
-#define IPC_GPRS_FAIL_USER_AUTHENTICATION 0x0007
-#define IPC_GPRS_FAIL_ACTIVATION_REJECT_GGSN 0x0008
-#define IPC_GPRS_FAIL_ACTIVATION_REJECT_UNSPECIFIED 0x0009
-#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUPPORTED 0x000A
-#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED 0x000B
-#define IPC_GPRS_FAIL_SERVICE_OPTION_OUT_OF_ORDER 0x000C
-#define IPC_GPRS_FAIL_NSAPI_IN_USE 0x000D
-
-#define IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT 3
+#include <samsung-ipc.h>
+
+#ifndef __SAMSUNG_IPC_GPRS_H__
+#define __SAMSUNG_IPC_GPRS_H__
+
+/*
+ * Types
+ */
+
+#define IPC_GPRS_DEFINE_PDP_CONTEXT 0x0D01
+#define IPC_GPRS_QOS 0x0D02
+#define IPC_GPRS_PS 0x0D03
+#define IPC_GPRS_PDP_CONTEXT 0x0D04
+#define IPC_GPRS_ENTER_DATA 0x0D05
+#define IPC_GPRS_SHOW_PDP_ADDR 0x0D06
+#define IPC_GPRS_MS_CLASS 0x0D07
+#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D08
+#define IPC_GPRS_IP_CONFIGURATION 0x0D09
+#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D0A
+#define IPC_GPRS_TFT 0x0D0B
+#define IPC_GPRS_HSDPA_STATUS 0x0D0C
+#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0D
+#define IPC_GPRS_DATA_DORMANT 0x0D0E
+#define IPC_GPRS_DUN_PIN_CTRL 0x0D0F
+#define IPC_GPRS_CALL_STATUS 0x0D10
+#define IPC_GPRS_PORT_LIST 0x0D11
+
+/*
+ * Values
+ */
+
+#define IPC_GPRS_STATE_NOT_ENABLED 0x00
+#define IPC_GPRS_STATE_ENABLED 0x01
+#define IPC_GPRS_STATE_DISABLED 0x03
+
+#define IPC_GPRS_FAIL_INSUFFICIENT_RESOURCES 0x0004
+#define IPC_GPRS_FAIL_MISSING_UKNOWN_APN 0x0005
+#define IPC_GPRS_FAIL_UNKNOWN_PDP_ADDRESS_TYPE 0x0006
+#define IPC_GPRS_FAIL_USER_AUTHENTICATION 0x0007
+#define IPC_GPRS_FAIL_ACTIVATION_REJECT_GGSN 0x0008
+#define IPC_GPRS_FAIL_ACTIVATION_REJECT_UNSPECIFIED 0x0009
+#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUPPORTED 0x000A
+#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED 0x000B
+#define IPC_GPRS_FAIL_SERVICE_OPTION_OUT_OF_ORDER 0x000C
+#define IPC_GPRS_FAIL_NSAPI_IN_USE 0x000D
+
+#define IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT 0x03
+
+/*
+ * Structures
+ */
struct ipc_gprs_define_pdp_context {
unsigned char enable;
unsigned char cid;
unsigned char unk;
unsigned char apn[124];
-};
+} __attribute__((__packed__));
struct ipc_gprs_pdp_context_set {
unsigned char enable;
@@ -71,17 +86,17 @@ struct ipc_gprs_pdp_context_set {
unsigned char password[32];
unsigned char unk1[32];
unsigned char unk2;
-};
+} __attribute__((__packed__));
struct ipc_gprs_pdp_context_get_desc {
unsigned char cid;
unsigned char state;
-};
+} __attribute__((__packed__));
struct ipc_gprs_pdp_context_get {
unsigned char unk;
struct ipc_gprs_pdp_context_get_desc desc[IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT];
-};
+} __attribute__((__packed__));
struct ipc_gprs_ip_configuration {
unsigned char cid;
@@ -93,37 +108,39 @@ struct ipc_gprs_ip_configuration {
unsigned char gateway[4];
unsigned char subnet_mask[4];
unsigned char unk2[4];
-};
+} __attribute__((__packed__));
struct ipc_gprs_call_status {
unsigned char cid;
unsigned char state;
unsigned short fail_cause;
-};
+} __attribute__((__packed__));
struct ipc_gprs_hsdpa_status {
unsigned char reg_state;
-};
+} __attribute__((__packed__));
struct ipc_gprs_ps {
unsigned char unk[2];
-};
+} __attribute__((__packed__));
struct ipc_gprs_current_session_data_counter {
unsigned char cid;
unsigned int rx_count;
unsigned int tx_count;
-};
+} __attribute__((__packed__));
struct ipc_gprs_port_list {
unsigned char unk[804];
-};
+} __attribute__((__packed__));
+
+/*
+ * Helpers
+ */
void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message);
-void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message,
- unsigned char cid, int enable, char *username, char *password);
-void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message,
- unsigned char cid, int enable, char *apn);
+void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message, unsigned char cid, int enable, char *username, char *password);
+void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message, unsigned char cid, int enable, char *apn);
#endif
diff --git a/include/misc.h b/include/misc.h
index c11ffd0..111e0ce 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -1,6 +1,8 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
* 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,27 +20,47 @@
*
*/
-#ifndef __MISC_H__
-#define __MISC_H__
+#include <samsung-ipc.h>
-#if defined(DEVICE_IPC_V4)
-#include "device/ipc-v4/misc.h"
-#elif defined(DEVICE_H1)
-#include "device/h1/misc.h"
-#endif
+#ifndef __SAMSUNG_IPC_MISC_H__
+#define __SAMSUNG_IPC_MISC_H__
+
+/*
+ * Types
+ */
+
+#define IPC_MISC_ME_VERSION 0x0A01
+#define IPC_MISC_ME_IMSI 0x0A02
+#define IPC_MISC_ME_SN 0x0A03
+#define IPC_MISC_TIME_INFO 0x0A05
+#define IPC_MISC_DEBUG_LEVEL 0x0A0C
+
+/*
+ * Values
+ */
-struct ipc_message_info;
+#define IPC_MISC_ME_SN_SERIAL_NUM 0x01
+#define IPC_MISC_ME_SN_SERIAL_NUM_SERIAL 0x04
+#define IPC_MISC_ME_SN_SERIAL_NUM_MANUFACTURE_DATE 0x05
+#define IPC_MISC_ME_SN_SERIAL_NUM_BARCODE 0x06
-#define IPC_MISC_ME_VERSION 0x0A01
-#define IPC_MISC_ME_IMSI 0x0A02
-#define IPC_MISC_ME_SN 0x0A03
-#define IPC_MISC_TIME_INFO 0x0A05
-#define IPC_MISC_DEBUG_LEVEL 0x0A0C
+/*
+ * Structures
+ */
+
+struct ipc_misc_me_version {
+ unsigned char unk;
+ char sw_version[32];
+ char hw_version[32];
+ char cal_date[32];
+ char misc[32];
+} __attribute__((__packed__));
-#define IPC_MISC_ME_SN_SERIAL_NUM 0x01
-#define IPC_MISC_ME_SN_SERIAL_NUM_SERIAL 0x04
-#define IPC_MISC_ME_SN_SERIAL_NUM_MANUFACTURE_DATE 0x05
-#define IPC_MISC_ME_SN_SERIAL_NUM_BARCODE 0x06
+struct ipc_misc_me_sn {
+ unsigned char type; // IPC_MISC_ME_SN_SERIAL_NUM*
+ unsigned char length;
+ char data[32];
+} __attribute__((__packed__));
struct ipc_misc_time_info {
unsigned char tz_valid, daylight_valid;
@@ -48,7 +70,11 @@ struct ipc_misc_time_info {
char plmn[6];
} __attribute__((__packed__));
-char* ipc_misc_me_imsi_response_get_imsi(struct ipc_message_info *response);
+/*
+ * Helpers
+ */
+
+char *ipc_misc_me_imsi_response_get_imsi(struct ipc_message_info *response);
#endif
diff --git a/include/net.h b/include/net.h
index ed63b37..37a5338 100644
--- a/include/net.h
+++ b/include/net.h
@@ -1,6 +1,8 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
* 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,49 +20,64 @@
*
*/
-#ifndef __NET_H__
-#define __NET_H__
+#include <samsung-ipc.h>
-#if defined(DEVICE_IPC_V4)
-#include "device/ipc-v4/net.h"
-#elif defined(DEVICE_H1)
-#include "device/h1/net.h"
-#endif
+#ifndef __SAMSUNG_IPC_NET_H__
+#define __SAMSUNG_IPC_NET_H__
+
+/*
+ * Types
+ */
+
+#define IPC_NET_PREF_PLMN 0x0801
+#define IPC_NET_PLMN_SEL 0x0802
+#define IPC_NET_CURRENT_PLMN 0x0803
+#define IPC_NET_PLMN_LIST 0x0804
+#define IPC_NET_REGIST 0x0805
+#define IPC_NET_SUBSCRIBER_NUM 0x0806
+#define IPC_NET_BAND_SEL 0x0807
+#define IPC_NET_SERVICE_DOMAIN_CONFIG 0x0808
+#define IPC_NET_POWERON_ATTACH 0x0809
+#define IPC_NET_MODE_SEL 0x080A
+#define IPC_NET_ACQ_ORDER 0x080B
+#define IPC_NET_IDENTITY 0x080C
+#define IPC_NET_CURRENT_RRC_STATUS 0x080D
+
+/*
+ * Values
+ */
+
+#define IPC_NET_PLMN_STATUS_AVAILABLE 0x02
+#define IPC_NET_PLMN_STATUS_CURRENT 0x03
+#define IPC_NET_PLMN_STATUS_FORBIDDEN 0x04
+
+#define IPC_NET_PLMN_SEL_MANUAL 0x03
+#define IPC_NET_PLMN_SEL_AUTO 0x02
+
+#define IPC_NET_REGISTRATION_STATE_NONE 0x01
+#define IPC_NET_REGISTRATION_STATE_HOME 0x02
+#define IPC_NET_REGISTRATION_STATE_SEARCHING 0x03
+#define IPC_NET_REGISTRATION_STATE_EMERGENCY 0x04
+#define IPC_NET_REGISTRATION_STATE_UNKNOWN 0x05
+#define IPC_NET_REGISTRATION_STATE_ROAMING 0x06
+
+#define IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN 0xff
+#define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x00
+#define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x01
+#define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x02
+#define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x03
+#define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x04
-#define IPC_NET_PREF_PLMN 0x0801
-#define IPC_NET_PLMN_SEL 0x0802
-#define IPC_NET_CURRENT_PLMN 0x0803
-#define IPC_NET_PLMN_LIST 0x0804
-#define IPC_NET_REGIST 0x0805
-#define IPC_NET_SUBSCRIBER_NUM 0x0806
-#define IPC_NET_BAND_SEL 0x0807
-#define IPC_NET_SERVICE_DOMAIN_CONFIG 0x0808
-#define IPC_NET_POWERON_ATTACH 0x0809
-#define IPC_NET_MODE_SEL 0x080A
-#define IPC_NET_ACQ_ORDER 0x080B
-#define IPC_NET_IDENTITY 0x080C
-#define IPC_NET_CURRENT_RRC_STATUS 0x080D
-
-#define IPC_NET_PLMN_STATUS_AVAILABLE 0x02
-#define IPC_NET_PLMN_STATUS_CURRENT 0x03
-#define IPC_NET_PLMN_STATUS_FORBIDDEN 0x04
-
-#define IPC_NET_PLMN_SEL_MANUAL 0x03
-#define IPC_NET_PLMN_SEL_AUTO 0x02
-
-#define IPC_NET_REGISTRATION_STATE_NONE 0x01
-#define IPC_NET_REGISTRATION_STATE_HOME 0x02
-#define IPC_NET_REGISTRATION_STATE_SEARCHING 0x03
-#define IPC_NET_REGISTRATION_STATE_EMERGENCY 0x04
-#define IPC_NET_REGISTRATION_STATE_UNKNOWN 0x05
-#define IPC_NET_REGISTRATION_STATE_ROAMING 0x06
-
-#define IPC_NET_SERVICE_DOMAIN_GSM 0x02
-#define IPC_NET_SERVICE_DOMAIN_GPRS 0x03
-
-#define IPC_NET_MODE_SEL_GSM_UMTS 0x01
-#define IPC_NET_MODE_SEL_GSM_ONLY 0x02
-#define IPC_NET_MODE_SEL_UMTS_ONLY 0x03
+#define IPC_NET_SERVICE_DOMAIN_GSM 0x02
+#define IPC_NET_SERVICE_DOMAIN_GPRS 0x03
+
+#define IPC_NET_MODE_SEL_GSM_UMTS 0x01
+#define IPC_NET_MODE_SEL_GSM_ONLY 0x02
+#define IPC_NET_MODE_SEL_UMTS_ONLY 0x03
+
+/*
+ * Structures
+ */
struct ipc_net_regist_get {
/* ignore, ipc_net_regist_get_setup will do for you */
@@ -82,6 +99,15 @@ struct ipc_net_regist_response {
char rej_cause;
} __attribute__((__packed__));
+struct ipc_net_current_plmn_response {
+ char unk0;
+ unsigned char slevel;
+ char unk1;
+ char plmn[5];
+ unsigned char type; // IPC_NET_SERVICE_TYPE_... ?
+ unsigned short lac;
+} __attribute__((__packed__));
+
struct ipc_net_plmn_entry {
unsigned char status; // IPC_NET_PLMN_STATUS_...
char plmn[6];
@@ -107,6 +133,10 @@ struct ipc_net_plmn_sel_set {
unsigned char act; // IPC_NET_ACCESS_TECHNOLOGY_...
} __attribute__((__packed__));
+/*
+ * Helpers
+ */
+
void ipc_net_regist_get_setup(struct ipc_net_regist_get *message, unsigned char domain);
void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_set *message, unsigned char mode, char *plmn, unsigned char act);
diff --git a/include/pwr.h b/include/pwr.h
index 4fdbdd4..1256bfe 100644
--- a/include/pwr.h
+++ b/include/pwr.h
@@ -1,8 +1,9 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2013 Paul Kocialkowski <contact@paulk.fr>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
* Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * 2011 Simon Busch <morphis@gravedo.de>
*
* libsamsung-ipc is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,21 +20,35 @@
*
*/
-#ifndef __PWR_H__
-#define __PWR_H__
+#include <samsung-ipc.h>
-#define IPC_PWR_R(f) (f & 0xff)
+#ifndef __SAMSUNG_IPC_PWR_H__
+#define __SAMSUNG_IPC_PWR_H__
+
+/*
+ * Types
+ */
-#define IPC_PWR_PHONE_PWR_UP 0x0101
-#define IPC_PWR_PHONE_PWR_OFF 0x0102
-#define IPC_PWR_PHONE_RESET 0x0103
-#define IPC_PWR_BATT_STATUS 0x0104
-#define IPC_PWR_BATT_TYPE 0x0105
-#define IPC_PWR_BATT_COMP 0x0106
-#define IPC_PWR_PHONE_STATE 0x0107
+#define IPC_PWR_PHONE_PWR_UP 0x0101
+#define IPC_PWR_PHONE_PWR_OFF 0x0102
+#define IPC_PWR_PHONE_RESET 0x0103
+#define IPC_PWR_BATT_STATUS 0x0104
+#define IPC_PWR_BATT_TYPE 0x0105
+#define IPC_PWR_BATT_COMP 0x0106
+#define IPC_PWR_PHONE_STATE 0x0107
+
+/*
+ * Values
+ */
-#define IPC_PWR_PHONE_STATE_LPM 0x0001
-#define IPC_PWR_PHONE_STATE_NORMAL 0x0202
+#define IPC_PWR_PHONE_STATE_LPM 0x0001
+#define IPC_PWR_PHONE_STATE_NORMAL 0x0202
+
+/*
+ * Macros
+ */
+
+#define IPC_PWR_R(f) (f & 0xff)
#endif
diff --git a/include/radio.h b/include/radio.h
index b9edd56..7581aa9 100644
--- a/include/radio.h
+++ b/include/radio.h
@@ -23,8 +23,6 @@
#include <stdint.h>
-#include "types.h"
-
#define IPC_CLIENT_TYPE_FMT 0
#define IPC_CLIENT_TYPE_RFS 1
@@ -57,6 +55,8 @@ struct ipc_client_gprs_capabilities {
int cid_max;
};
+#include "types.h"
+
typedef void (*ipc_client_log_handler_cb)(const char *message, void *user_data);
typedef int (*ipc_io_handler_cb)(void *data, unsigned int size, void *io_data);
diff --git a/include/rfs.h b/include/rfs.h
index 0df65d3..523fb23 100644
--- a/include/rfs.h
+++ b/include/rfs.h
@@ -1,7 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
- * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
+ * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
*
* libsamsung-ipc is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,25 +18,36 @@
*
*/
-#ifndef __RFS_H__
-#define __RFS_H__
+#include <samsung-ipc.h>
-struct ipc_client;
-struct ipc_message_info;
+#ifndef __SAMSUNG_IPC_RFS_H__
+#define __SAMSUNG_IPC_RFS_H__
-#define IPC_RFS_NV_READ_ITEM 0x4201
-#define IPC_RFS_NV_WRITE_ITEM 0x4202
+/*
+ * Types
+ */
+
+#define IPC_RFS_NV_READ_ITEM 0x4201
+#define IPC_RFS_NV_WRITE_ITEM 0x4202
+
+/*
+ * Values
+ */
-#define NV_DATA_PATH_DEFAULT "/efs/nv_data.bin"
-#define NV_DATA_MD5_PATH_DEFAULT "/efs/nv_data.bin.md5"
-#define NV_DATA_BAK_PATH_DEFAULT "/efs/.nv_data.bak"
-#define NV_DATA_MD5_BAK_PATH_DEFAULT "/efs/.nv_data.bak.md5"
-#define NV_STATE_PATH_DEFAULT "/efs/.nv_state"
-#define NV_DATA_SECRET_DEFAULT "Samsung_Android_RIL"
-#define NV_DATA_SIZE_DEFAULT 0x200000
-#define NV_DATA_CHUNK_SIZE_DEFAULT 0x1000
+#define NV_DATA_PATH_DEFAULT "/efs/nv_data.bin"
+#define NV_DATA_MD5_PATH_DEFAULT "/efs/nv_data.bin.md5"
+#define NV_DATA_BAK_PATH_DEFAULT "/efs/.nv_data.bak"
+#define NV_DATA_MD5_BAK_PATH_DEFAULT "/efs/.nv_data.bak.md5"
+#define NV_STATE_PATH_DEFAULT "/efs/.nv_state"
+#define NV_DATA_SECRET_DEFAULT "Samsung_Android_RIL"
+#define NV_DATA_SIZE_DEFAULT 0x200000
+#define NV_DATA_CHUNK_SIZE_DEFAULT 0x1000
-#define MD5_STRING_SIZE MD5_DIGEST_LENGTH * 2 + 1
+#define MD5_STRING_SIZE MD5_DIGEST_LENGTH * 2 + 1
+
+/*
+ * Structures
+ */
struct ipc_rfs_io {
unsigned int offset;
@@ -49,6 +60,10 @@ struct ipc_rfs_io_confirm {
unsigned int length;
} __attribute__((__packed__));
+/*
+ * Helpers
+ */
+
void md5hash2string(char *out, uint8_t *in);
char *nv_data_path(struct ipc_client *client);
char *nv_data_md5_path(struct ipc_client *client);
diff --git a/include/samsung-ipc.h b/include/samsung-ipc.h
index 221b395..2a15317 100644
--- a/include/samsung-ipc.h
+++ b/include/samsung-ipc.h
@@ -1,4 +1,4 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
* Copyright (C) 2012 Simon Busch <morphis@gravedo.de>
@@ -18,8 +18,8 @@
*
*/
-#ifndef SAMSUNGIPC_H_
-#define SAMSUNGIPC_H_
+#ifndef __SAMSUNG_IPC_H__
+#define __SAMSUNG_IPC_H__
#include <radio.h>
diff --git a/include/sec.h b/include/sec.h
index faee7e3..9a3667a 100644
--- a/include/sec.h
+++ b/include/sec.h
@@ -1,8 +1,8 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
* Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
- * Copyright (C) 2011 Paul Kocialkowski <contact@paulk.fr>
*
* libsamsung-ipc is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,72 +19,84 @@
*
*/
-#ifndef __SEC_H__
-#define __SEC_H__
+#include <samsung-ipc.h>
-struct ipc_message_info;
+#ifndef __SAMSUNG_IPC_SEC_H__
+#define __SAMSUNG_IPC_SEC_H__
+
+/*
+ * Types
+ */
/* Possible SEC related IPC message types */
-#define IPC_SEC_SIM_STATUS 0x0501
-#define IPC_SEC_PHONE_LOCK 0x0502
-#define IPC_SEC_CHANGE_LOCKING_PW 0x0503
-#define IPC_SEC_SIM_LANG 0x0504
-#define IPC_SEC_RSIM_ACCESS 0x0505
-#define IPC_SEC_GSIM_ACCESS 0x0506
-#define IPC_SEC_SIM_ICC_TYPE 0x0507
-#define IPC_SEC_LOCK_INFO 0x0508
-#define IPC_SEC_ISIM_AUTH 0x0509
+#define IPC_SEC_SIM_STATUS 0x0501
+#define IPC_SEC_PHONE_LOCK 0x0502
+#define IPC_SEC_CHANGE_LOCKING_PW 0x0503
+#define IPC_SEC_SIM_LANG 0x0504
+#define IPC_SEC_RSIM_ACCESS 0x0505
+#define IPC_SEC_GSIM_ACCESS 0x0506
+#define IPC_SEC_SIM_ICC_TYPE 0x0507
+#define IPC_SEC_LOCK_INFO 0x0508
+#define IPC_SEC_ISIM_AUTH 0x0509
+
+/*
+ * Values
+ */
/* SIM status */
-#define IPC_SEC_SIM_STATUS_READY 0x00
-#define IPC_SEC_SIM_STATUS_SIM_LOCK_REQUIRED 0x01
-#define IPC_SEC_SIM_STATUS_INSIDE_PF_ERROR 0x02
-#define IPC_SEC_SIM_STATUS_LOCK_SC 0x03
-#define IPC_SEC_SIM_STATUS_LOCK_FD 0x04
-#define IPC_SEC_SIM_STATUS_LOCK_PN 0x05
-#define IPC_SEC_SIM_STATUS_LOCK_PU 0x06
-#define IPC_SEC_SIM_STATUS_LOCK_PP 0x07
-#define IPC_SEC_SIM_STATUS_LOCK_PC 0x08
-#define IPC_SEC_SIM_STATUS_CARD_NOT_PRESENT 0x80
-#define IPC_SEC_SIM_STATUS_CARD_ERROR 0x81
-#define IPC_SEC_SIM_STATUS_INIT_COMPLETE 0x82
-#define IPC_SEC_SIM_STATUS_PB_INIT_COMPLETE 0x83
+#define IPC_SEC_SIM_STATUS_READY 0x00
+#define IPC_SEC_SIM_STATUS_SIM_LOCK_REQUIRED 0x01
+#define IPC_SEC_SIM_STATUS_INSIDE_PF_ERROR 0x02
+#define IPC_SEC_SIM_STATUS_LOCK_SC 0x03
+#define IPC_SEC_SIM_STATUS_LOCK_FD 0x04
+#define IPC_SEC_SIM_STATUS_LOCK_PN 0x05
+#define IPC_SEC_SIM_STATUS_LOCK_PU 0x06
+#define IPC_SEC_SIM_STATUS_LOCK_PP 0x07
+#define IPC_SEC_SIM_STATUS_LOCK_PC 0x08
+#define IPC_SEC_SIM_STATUS_CARD_NOT_PRESENT 0x80
+#define IPC_SEC_SIM_STATUS_CARD_ERROR 0x81
+#define IPC_SEC_SIM_STATUS_INIT_COMPLETE 0x82
+#define IPC_SEC_SIM_STATUS_PB_INIT_COMPLETE 0x83
/* SIM/Network facility types */
-#define IPC_SEC_FACILITY_TYPE_SC 0x03
-#define IPC_SEC_FACILITY_TYPE_FD 0x04
-#define IPC_SEC_FACILITY_TYPE_PN 0x05
-#define IPC_SEC_FACILITY_TYPE_PU 0x06
-#define IPC_SEC_FACILITY_TYPE_PP 0x07
-#define IPC_SEC_FACILITY_TYPE_PC 0x08
+#define IPC_SEC_FACILITY_TYPE_SC 0x03
+#define IPC_SEC_FACILITY_TYPE_FD 0x04
+#define IPC_SEC_FACILITY_TYPE_PN 0x05
+#define IPC_SEC_FACILITY_TYPE_PU 0x06
+#define IPC_SEC_FACILITY_TYPE_PP 0x07
+#define IPC_SEC_FACILITY_TYPE_PC 0x08
/* SIM card (SC) facility lock types */
-#define IPC_SEC_FACILITY_LOCK_TYPE_SC_UNLOCKED 0x00
-#define IPC_SEC_FACILITY_LOCK_TYPE_SC_PIN1_REQ 0x01
-#define IPC_SEC_FACILITY_LOCK_TYPE_SC_PUK_REQ 0x02
-#define IPC_SEC_FACILITY_LOCK_TYPE_SC_CARD_BLOCKED 0x05
+#define IPC_SEC_FACILITY_LOCK_TYPE_SC_UNLOCKED 0x00
+#define IPC_SEC_FACILITY_LOCK_TYPE_SC_PIN1_REQ 0x01
+#define IPC_SEC_FACILITY_LOCK_TYPE_SC_PUK_REQ 0x02
+#define IPC_SEC_FACILITY_LOCK_TYPE_SC_CARD_BLOCKED 0x05
/* PIN type */
-#define IPC_SEC_PIN_TYPE_PIN1 0x03
-#define IPC_SEC_PIN_TYPE_PIN2 0x09
+#define IPC_SEC_PIN_TYPE_PIN1 0x03
+#define IPC_SEC_PIN_TYPE_PIN2 0x09
/* Type of the used SIM card */
-#define IPC_SEC_SIM_CARD_TYPE_UNKNOWN 0x00
-#define IPC_SEC_SIM_CARD_TYPE_SIM 0x01
-#define IPC_SEC_SIM_CARD_TYPE_USIM 0x02
+#define IPC_SEC_SIM_CARD_TYPE_UNKNOWN 0x00
+#define IPC_SEC_SIM_CARD_TYPE_SIM 0x01
+#define IPC_SEC_SIM_CARD_TYPE_USIM 0x02
/* Possible RSIM commads (see TS 27.00.1 8.18) */
-#define IPC_SEC_RSIM_COMMAND_READ_BINARY 0xb0
-#define IPC_SEC_RSIM_COMMAND_READ_RECORD 0xb2
-#define IPC_SEC_RSIM_COMMAND_GET_RESPONSE 0xc0
-#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xd6
-#define IPC_SEC_RSIM_COMMAND_UPDATE_RECORD 0xdc
-#define IPC_SEC_RSIM_COMMAND_STATUS 0xf2
-#define IPC_SEC_RSIM_COMMAND_RETRIEVE_DATA 0xcb
-#define IPC_SEC_RSIM_COMMAND_SET_DATA 0xdb
-
-#define IPC_SEC_RSIM_FILE_STRUCTURE_TRANSPARENT 0x83
-#define IPC_SEC_RSIM_FILE_STRUCTURE_LINEAR_FIXED 0x00
+#define IPC_SEC_RSIM_COMMAND_READ_BINARY 0xb0
+#define IPC_SEC_RSIM_COMMAND_READ_RECORD 0xb2
+#define IPC_SEC_RSIM_COMMAND_GET_RESPONSE 0xc0
+#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xd6
+#define IPC_SEC_RSIM_COMMAND_UPDATE_RECORD 0xdc
+#define IPC_SEC_RSIM_COMMAND_STATUS 0xf2
+#define IPC_SEC_RSIM_COMMAND_RETRIEVE_DATA 0xcb
+#define IPC_SEC_RSIM_COMMAND_SET_DATA 0xdb
+
+#define IPC_SEC_RSIM_FILE_STRUCTURE_TRANSPARENT 0x83
+#define IPC_SEC_RSIM_FILE_STRUCTURE_LINEAR_FIXED 0x00
+
+/*
+ * Structures
+ */
struct ipc_sec_sim_status_response {
/* IPC_SEC_SIM_STATUS_... */
@@ -169,19 +181,15 @@ struct ipc_sec_sim_icc_type {
unsigned char type;
} __attribute__((__packed__));
-void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message,
- unsigned char pin_type, char *pin1, char *pin2);
-
-void ipc_sec_lock_info_get_setup(struct ipc_sec_lock_info_get *message,
- unsigned char pin_type);
-
-void ipc_sec_phone_lock_set_setup(struct ipc_sec_phone_lock_set *message,
- int pin_type, int enable, char *passwd);
-
-char* ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response);
+/*
+ * Helpers
+ */
-void ipc_sec_change_locking_pw_set_setup(struct ipc_sec_change_locking_pw_set *message,
- int type, char *passwd_old, char *passwd_new);
+void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message, unsigned char pin_type, char *pin1, char *pin2);
+void ipc_sec_lock_info_get_setup(struct ipc_sec_lock_info_get *message, unsigned char pin_type);
+void ipc_sec_phone_lock_set_setup(struct ipc_sec_phone_lock_set *message, int pin_type, int enable, char *passwd);
+char *ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response);
+void ipc_sec_change_locking_pw_set_setup(struct ipc_sec_change_locking_pw_set *message, int type, char *passwd_old, char *passwd_new);
#endif
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
diff --git a/include/snd.h b/include/snd.h
index 742a555..630d818 100644
--- a/include/snd.h
+++ b/include/snd.h
@@ -1,4 +1,4 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
* Copyright (C) 2011 Paul Kocialkowski <contact@oaulk.fr>
@@ -18,33 +18,45 @@
*
*/
-#ifndef __SND_H__
-#define __SND_H__
-
-struct ipc_message_info;
-
-#define IPC_SND_SPKR_VOLUME_CTRL 0x0901
-#define IPC_SND_MIC_MUTE_CTRL 0x0902
-#define IPC_SND_AUDIO_PATH_CTRL 0x0903
-#define IPC_SND_AUDIO_SOURCE_CTRL 0x0904
-#define IPC_SND_LOOPBACK_CTRL 0x0905
-#define IPC_SND_VOICE_RECORDING_CTRL 0x0906
-#define IPC_SND_VIDEO_CALL_CTRL 0x0907
-#define IPC_SND_RINGBACK_TONE_CTRL 0x0908
-#define IPC_SND_CLOCK_CTRL 0x0909
-#define IPC_SND_WB_AMR_STATUS 0x090A
-
-#define IPC_SND_VOLUME_TYPE_VOICE 0x01
-#define IPC_SND_VOLUME_TYPE_SPEAKER 0x11
-#define IPC_SND_VOLUME_TYPE_HEADSET 0x31
-#define IPC_SND_VOLUME_TYPE_BTVOICE 0x41
-
-#define IPC_SND_AUDIO_PATH_HANDSET 0x01
-#define IPC_SND_AUDIO_PATH_HEADSET 0x02
-#define IPC_SND_AUDIO_PATH_SPEAKER 0x06
-#define IPC_SND_AUDIO_PATH_BLUETOOTH 0x04
-#define IPC_SND_AUDIO_PATH_BLUETOOTH_NO_NR 0x08
-#define IPC_SND_AUDIO_PATH_HEADPHONE 0x07
+#include <samsung-ipc.h>
+
+#ifndef __SAMSUNG_IPC_SND_H__
+#define __SAMSUNG_IPC_SND_H__
+
+/*
+ * Types
+ */
+
+#define IPC_SND_SPKR_VOLUME_CTRL 0x0901
+#define IPC_SND_MIC_MUTE_CTRL 0x0902
+#define IPC_SND_AUDIO_PATH_CTRL 0x0903
+#define IPC_SND_AUDIO_SOURCE_CTRL 0x0904
+#define IPC_SND_LOOPBACK_CTRL 0x0905
+#define IPC_SND_VOICE_RECORDING_CTRL 0x0906
+#define IPC_SND_VIDEO_CALL_CTRL 0x0907
+#define IPC_SND_RINGBACK_TONE_CTRL 0x0908
+#define IPC_SND_CLOCK_CTRL 0x0909
+#define IPC_SND_WB_AMR_STATUS 0x090A
+
+/*
+ * Values
+ */
+
+#define IPC_SND_VOLUME_TYPE_VOICE 0x01
+#define IPC_SND_VOLUME_TYPE_SPEAKER 0x11
+#define IPC_SND_VOLUME_TYPE_HEADSET 0x31
+#define IPC_SND_VOLUME_TYPE_BTVOICE 0x41
+
+#define IPC_SND_AUDIO_PATH_HANDSET 0x01
+#define IPC_SND_AUDIO_PATH_HEADSET 0x02
+#define IPC_SND_AUDIO_PATH_SPEAKER 0x06
+#define IPC_SND_AUDIO_PATH_BLUETOOTH 0x04
+#define IPC_SND_AUDIO_PATH_BLUETOOTH_NO_NR 0x08
+#define IPC_SND_AUDIO_PATH_HEADPHONE 0x07
+
+/*
+ * Structures
+ */
struct ipc_snd_spkr_volume_ctrl {
unsigned char type;
diff --git a/include/ss.h b/include/ss.h
index 3e483d0..9ecc0f0 100644
--- a/include/ss.h
+++ b/include/ss.h
@@ -1,8 +1,8 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
- * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
* Copyright (C) 2012 Paul Kocialkowski <contact@oaulk.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
* it under the terms of the GNU General Public License as published by
@@ -19,8 +19,14 @@
*
*/
-#ifndef __SS_H__
-#define __SS_H__
+#include <samsung-ipc.h>
+
+#ifndef __SAMSUNG_IPC_SS_H__
+#define __SAMSUNG_IPC_SS_H__
+
+/*
+ * Types
+ */
#define IPC_SS_WAITING 0x0C01
#define IPC_SS_CLI 0x0C02
@@ -33,6 +39,10 @@
#define IPC_SS_AOC 0x0C09
#define IPC_SS_RELEASE_COMPLETE 0x0C0A
+/*
+ * Values
+ */
+
#define IPC_SS_USSD_NO_ACTION_REQUIRE 0x01
#define IPC_SS_USSD_ACTION_REQUIRE 0x02
#define IPC_SS_USSD_TERMINATED_BY_NET 0x03
@@ -41,8 +51,10 @@
#define IPC_SS_USSD_TIME_OUT 0x06 //guess
/*
- * This is followed by the encoded (according to the dcs) bytes of the USSD message.
+ * Structures
*/
+
+/* This is followed by the encoded (according to the dcs) bytes of the USSD message */
struct ipc_ss_ussd {
unsigned char state;
unsigned char dcs;
diff --git a/include/wakelock.h b/include/wakelock.h
index aa10521..d9dcdae 100644
--- a/include/wakelock.h
+++ b/include/wakelock.h
@@ -1,4 +1,4 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
* Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com>
@@ -18,10 +18,10 @@
*
*/
-#ifndef __WAKELOCK_H__
-#define __WAKELOCK_H__
+#ifndef __SAMSUNG_IPC_WAKELOCK_H__
+#define __SAMSUNG_IPC_WAKELOCK_H__
extern int wake_lock(char *lock_name);
extern int wake_unlock(char *lock_name);
-#endif //__WAKELOCK_H__
+#endif