diff options
-rw-r--r-- | include/net.h | 15 | ||||
-rw-r--r-- | net.c | 10 |
2 files changed, 20 insertions, 5 deletions
diff --git a/include/net.h b/include/net.h index 5f2c176..34114a4 100644 --- a/include/net.h +++ b/include/net.h @@ -52,6 +52,9 @@ #define MSM_NET_PLMN_STATUS_CURRENT 3 #define MSM_NET_PLMN_STATUS_FORBIDDEN 4 +#define MSM_NET_PLMN_SEL_MANUAL 0 +#define MSM_NET_PLMN_SEL_AUTO 1 + struct msm_net_current_plmn { char unk; unsigned char slevel; @@ -60,11 +63,17 @@ struct msm_net_current_plmn { unsigned short lac; } __attribute__((__packed__)); +struct msm_net_regist_set { + unsigned char net; + unsigned char domain; +} __attribute__((__packed__)); + + struct msm_net_regist { - unsigned char act, unk0, status, unk1; + unsigned char act, domain, status, edge; unsigned short lac; unsigned int cid; - char unk2; + char rej_cause; } __attribute__((__packed__)); struct msm_net_plmn_entry { @@ -82,7 +91,7 @@ struct msm_net_plmn_entries { void msm_net_current_plmn(int request_id); void msm_net_plmn_list(int request_id); void msm_net_identity(int request_id); -void msm_net_regist(int request_id); +void msm_net_regist(int request_id, unsigned char type); #endif @@ -70,8 +70,14 @@ void msm_net_identity(int request_id) msm_send_get(MSM_NET_IDENTITY, request_id); } -void msm_net_regist(int request_id) +void msm_net_regist(int request_id, unsigned char type) { - msm_send_get(MSM_NET_REGIST, request_id); + unsigned char data[] = { 0xff, 0x00 }; + if(type == 0) { + msm_send_get(MSM_NET_REGIST, request_id); + } else { + data[1] = type; + msm_send(MSM_NET_REGIST, MSM_TYPE_GET, data, sizeof(data), request_id); + } } |