diff options
-rw-r--r-- | include/Makefile.am | 1 | ||||
-rw-r--r-- | include/gprs.h | 89 | ||||
-rw-r--r-- | include/types.h | 18 | ||||
-rw-r--r-- | samsung-ipc/Makefile.am | 1 | ||||
-rw-r--r-- | samsung-ipc/gprs.c | 43 | ||||
-rw-r--r-- | vapi/samsung-ipc-1.0.vapi | 79 |
6 files changed, 214 insertions, 17 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index ca83feb..87b8aff 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -14,4 +14,5 @@ samsung_ipcinclude_HEADERS = \ pwr.h \ types.h \ util.h \ + gprs.h \ $(NULL) diff --git a/include/gprs.h b/include/gprs.h new file mode 100644 index 0000000..29eba71 --- /dev/null +++ b/include/gprs.h @@ -0,0 +1,89 @@ +/** + * This file is part of libsamsung-ipc. + * + * 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 3 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 __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_SHOW_PDP_ADDR 0x0D05 +#define IPC_GPRS_MS_CLASS 0x0D06 +#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D07 +#define IPC_GPRS_IP_CONFIGURATION 0x0D08 +#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D09 +#define IPC_GPRS_TFT 0x0D0A +#define IPC_GPRS_HSDPA_STATUS 0x0D0B +#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0C +#define IPC_GPRS_DATA_DORMANT 0x0D0D +#define IPC_GPRS_DUN_PIN_CTRL 0x0D0E +#define IPC_GPRS_CALL_STATUS 0x0D0F + +#define IPC_GPRS_CALL_STATUS_TYPE_ON 0x0 +#define IPC_GPRS_CALL_STATUS_TYPE_OFF 0x3 + +#define IPC_GPRS_ERROR_UNAVAILABLE 0x94 + +struct ipc_gprs_define_pdp_context { + unsigned char unk0[3]; + unsigned char apn[124]; +} __attribute__((__packed__)); + +struct ipc_gprs_ip_configuration { + unsigned char unk0; + unsigned char field_flag; + unsigned char unk1; + unsigned char ip[4]; + unsigned char dns1[4]; + unsigned char dns2[4]; + unsigned char gateway[4]; + unsigned char subnet_mask[4]; +} __attribute__((__packed__)); + +struct ipc_gprs_call_status { + unsigned char cid; + unsigned char state; // IPC_GPRS_CALL_STATUS_TYPE_... + unsigned short reason; +} __attribute__((__packed__)); + +struct ipc_gprs_hsdpa_status { + unsigned char unk; +} __attribute__((__packed__)); + +struct ipc_gprs_pdp_context { + unsigned char unk0[6]; + unsigned char username[32]; + unsigned char password[32]; + unsigned char unk1[33]; +} __attribute__((__packed__)); + +struct ipc_gprs_ps { + unsigned char unk[2]; +} __attribute__((__packed__)); + +struct ipc_gprs_current_session_data_counter { + unsigned char unk[9]; +} __attribute__((__packed__)); + +void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context *message, char *username, char *password); + +#endif + diff --git a/include/types.h b/include/types.h index 3f8947a..e85d921 100644 --- a/include/types.h +++ b/include/types.h @@ -29,6 +29,7 @@ #include "sec.h" #include "sms.h" #include "pwr.h" +#include "gprs.h" /* AP -> Baseband */ #define IPC_TYPE_EXEC 0x01 @@ -81,23 +82,6 @@ #define IPC_SS_AOC 0x0C09 #define IPC_SS_RELEASE_COMPLETE 0x0C0A -/* GPRS */ -#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_SHOW_PDP_ADDR 0x0D05 -#define IPC_GPRS_MS_CLASS 0x0D06 -#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D07 -#define IPC_GPRS_IP_CONFIGURATION 0x0D08 -#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D09 -#define IPC_GPRS_TFT 0x0D0A -#define IPC_GPRS_HSDPA_STATUS 0x0D0B -#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0C -#define IPC_GPRS_DATA_DORMANT 0x0D0D -#define IPC_GPRS_DUN_PIN_CTRL 0x0D0E -#define IPC_GPRS_CALL_STATUS 0x0D0F - /* Sat */ #define IPC_SAT_PROFILE_DOWNLOAD 0x0E01 #define IPC_SAT_ENVELOPE_CMD 0x0E02 diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am index eea752b..e3d74fb 100644 --- a/samsung-ipc/Makefile.am +++ b/samsung-ipc/Makefile.am @@ -18,6 +18,7 @@ libsamsung_ipc_la_SOURCES = \ util.c \ misc.c \ sec.c \ + gprs.c \ $(NULL) libsamsung_ipc_la_LIBADD = \ diff --git a/samsung-ipc/gprs.c b/samsung-ipc/gprs.c new file mode 100644 index 0000000..abe59dd --- /dev/null +++ b/samsung-ipc/gprs.c @@ -0,0 +1,43 @@ +/** + * This file is part of libsamsung-ipc. + * + * 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 3 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/>. + * + */ + +#include <radio.h> +#include <string.h> +#include <stdlib.h> +#include <assert.h> + +void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message, char *apn) +{ + assert(message != NULL); + message->unk0[0] = 0x1; + message->unk0[1] = 0x1; + message->unk0[2] = 0x2; + strncpy(message->apn, apn, 124); +} + +void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context *message, char *username, char *password) +{ + assert(message != NULL); + message->unk0[0] = 0x1; + message->unk0[1] = 0x1; + message->unk0[2] = 0x13; + strncpy(message->username, username, 32); + strncpy(message->password, password, 32); +} diff --git a/vapi/samsung-ipc-1.0.vapi b/vapi/samsung-ipc-1.0.vapi index c9bd881..d98107f 100644 --- a/vapi/samsung-ipc-1.0.vapi +++ b/vapi/samsung-ipc-1.0.vapi @@ -578,6 +578,85 @@ namespace SamsungIpc /* ******************************************************************************** */ + namespace Gprs + { + [CCode (cname = "gint8", cprefix = "IPC_GPRS_CALL_STATUS_TYPE_", has_type_id = false)] + public enum CallStatusType + { + ON, + OFF, + } + + [CCode (cname = "gint8", cprefix = "IPC_GPRS_ERROR_", has_type_id = false)] + public enum ErrorType + { + UNAVAILABLE, + } + + [CCode (cname = "struct ipc_gprs_define_pdp_context", destroy_function = "")] + public struct DefinePdpContextMessage + { + public uint8[] unk0; + public uint8[] apn; + + [CCode (cname = "ipc_gprs_define_pdp_context_setup")] + public void setup(string apn); + } + + [CCode (cname = "struct ipc_gprs_ip_configuration", destroy_function = "")] + public struct IpConfigurationMessage + { + public uint8 unk0; + public uint8 field_flag; + public uint8 unk1; + public uint8[] ip; + public uint8[] dns1; + public uint8[] dns2; + public uint8[] gateway; + public uint8[] subnet_mask; + } + + [CCode (name = "struct ipc_gprs_call_status", destroy_function = "")] + public struct CallStatusMessage + { + public uint8 cid; + public CallStatusType status; + public uint16 reason; + } + + [CCode (cname = "struct ipc_gprs_hsdpa_status", destroy_function = "")] + public struct HsdpaStatusMessage + { + public uint8 unk; + } + + [CCode (cname = "struct ipc_gprs_pdp_context", destroy_function = "")] + public struct PdpContextMessage + { + public uint8[] unk0; + public uint8[] username; + public uint8[] password; + public uint8[] unk1; + + [CCode (cname = "ipc_gprs_pdp_context_setup")] + public void setup(string username, string password); + } + + [CCode (cname = "struct ipc_gprs_ps", destroy_function = "")] + public struct PsMessage + { + public uint8[] unk; + } + + [CCode (cname = "struct ipc_gprs_current_session_data_counter", destroy_function = "")] + public struct CurrentSessionDataCounterMessage + { + public uint8[] unk; + } + } + + /* ******************************************************************************** */ + [CCode (cname = "struct ipc_header", destroy_function = "")] public struct Header { |