diff options
-rw-r--r-- | include/net.h | 12 | ||||
-rw-r--r-- | samsung-ipc/net.c | 16 | ||||
-rw-r--r-- | vapi/samsung-ipc-1.0.vapi | 24 |
3 files changed, 48 insertions, 4 deletions
diff --git a/include/net.h b/include/net.h index ff4250b..6d693b4 100644 --- a/include/net.h +++ b/include/net.h @@ -45,8 +45,8 @@ #define IPC_NET_PLMN_STATUS_CURRENT 0x03 #define IPC_NET_PLMN_STATUS_FORBIDDEN 0x04 -#define IPC_NET_PLMN_SEL_MANUAL 0x00 -#define IPC_NET_PLMN_SEL_AUTO 0x01 +#define IPC_NET_PLMN_SEL_MODE_MANUAL 0x03 +#define IPC_NET_PLMN_SEL_MODE_AUTO 0x02 #define IPC_NET_REGISTRATION_STATE_NONE 0x01 #define IPC_NET_REGISTRATION_STATE_HOME 0x02 @@ -88,7 +88,15 @@ struct ipc_net_mode_sel { unsigned char mode; } __attribute__((__packed__)); +struct ipc_net_plmn_sel { + unsigned char mode; + unsigned char plmn[5]; + unsigned char unk0; + unsigned char unk1; +} __attribute__((__packed__)); + void ipc_net_regist_get(struct ipc_net_regist_get *message, int domain); +void ipc_net_plmn_sel_setup(struct ipc_net_plmn_sel *message, unsigned char mode, unsigned char *plmn); #endif diff --git a/samsung-ipc/net.c b/samsung-ipc/net.c index 85c5205..5f0d847 100644 --- a/samsung-ipc/net.c +++ b/samsung-ipc/net.c @@ -26,4 +26,20 @@ void ipc_net_regist_get(struct ipc_net_regist_get *message, int domain) message->domain = domain; } +void ipc_net_plmn_sel_setup(struct ipc_net_plmn_sel *message, unsigned char mode, unsigned char *plmn) +{ + if (mode == IPC_NET_PLMN_SEL_MODE_AUTO) + { + message->mode = IPC_NET_PLMN_SEL_MODE_AUTO; + message->unk1 = 0xff; + } + else if (mode == IPC_NET_PLMN_SEL_MODE_MANUAL) + { + message->mode = IPC_NET_PLMN_SEL_MODE_MANUAL; + strncpy(message->plmn, plmn, 5); + message->unk0 = 0x23; + message->unk1 = 0x4; + } +} + // vim:ts=4:sw=4:expandtab diff --git a/vapi/samsung-ipc-1.0.vapi b/vapi/samsung-ipc-1.0.vapi index 432a87f..d9b83b6 100644 --- a/vapi/samsung-ipc-1.0.vapi +++ b/vapi/samsung-ipc-1.0.vapi @@ -490,8 +490,8 @@ namespace SamsungIpc FORBIDDEN, } - [CCode (cname = "gint8", cprefix = "IPC_NET_PLMN_SEL_", has_type_id = false)] - public enum PlmnSelection + [CCode (cname = "gint8", cprefix = "IPC_NET_PLMN_SEL_MODE_", has_type_id = false)] + public enum PlmnSelectionMode { MANUAL, AUTO, @@ -615,6 +615,26 @@ namespace SamsungIpc } } } + + [CCode (cname = "struct ipc_net_plmn_sel", destroy_function = "")] + public struct PlmnSelectionMessage + { + public uint8 mode; + public uint8[] plmn; + + [CCode (cname = "ipc_net_plmn_sel_setup")] + public void setup(uint8 mode, string plmn); + + public unowned uint8[] data + { + get + { + unowned uint8[] res = (uint8[])(&this); + res.length = (int) sizeof( PlmnSelectionMessage ); + return res; + } + } + } } /* ******************************************************************************** */ |