blob: d4372b888df6694a4ca26cff41c693ce3a7863dc [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef CONFIG_MIN_8M_VERSION
2#include "at_context.h"
3
4int ext_LocklistAuth_func(char *at_paras, void ** res_msg)
5{
xf.li6236ea72023-07-26 04:58:33 -07006 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKLISTAUTH_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
7 return AT_CONTINUE;
8 else{
9 *res_msg = at_err_build(ATERR_PROC_FAILED);
10 return AT_END;
11 }
lh9ed821d2023-04-07 01:36:19 -070012}
13
14int ext_LocknetList_set_func(char *at_paras, void ** res_msg)
15{
xf.li6236ea72023-07-26 04:58:33 -070016 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
lh9ed821d2023-04-07 01:36:19 -070017 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070018 else{
19 *res_msg = at_err_build(ATERR_PROC_FAILED);
20 return AT_END;
21 }
lh9ed821d2023-04-07 01:36:19 -070022}
23
24int ext_LocknetKey_func(char *at_paras, void ** res_msg)
25{
xf.li6236ea72023-07-26 04:58:33 -070026 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETKEY_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
lh9ed821d2023-04-07 01:36:19 -070027 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070028 else{
29 *res_msg = at_err_build(ATERR_PROC_FAILED);
30 return AT_END;
31 }
lh9ed821d2023-04-07 01:36:19 -070032}
33
34int ext_LocknetAmtStatus_get_func(char *at_paras, void ** res_msg)
35{
xf.li6236ea72023-07-26 04:58:33 -070036 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAMTSTATUS_GET_REQ, 0, NULL,0))
lh9ed821d2023-04-07 01:36:19 -070037 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070038 else{
39 *res_msg = at_err_build(ATERR_PROC_FAILED);
40 return AT_END;
41 }
lh9ed821d2023-04-07 01:36:19 -070042}
43
44int ext_LocknetDigest_get_func(char *at_paras, void ** res_msg)
45{
xf.li6236ea72023-07-26 04:58:33 -070046 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETDIGEST_GET_REQ, 0, NULL,0))
lh9ed821d2023-04-07 01:36:19 -070047 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070048 else{
49 *res_msg = at_err_build(ATERR_PROC_FAILED);
50 return AT_END;
51 }
lh9ed821d2023-04-07 01:36:19 -070052}
53
54int ext_LocknetSign_set_func(char *at_paras, void ** res_msg)
55{
xf.li6236ea72023-07-26 04:58:33 -070056 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSIGN_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
lh9ed821d2023-04-07 01:36:19 -070057 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070058 else{
59 *res_msg = at_err_build(ATERR_PROC_FAILED);
60 return AT_END;
61 }
lh9ed821d2023-04-07 01:36:19 -070062}
63
64int ext_LocknetLevel_get_func(char *at_paras, void ** res_msg)
65{
xf.li6236ea72023-07-26 04:58:33 -070066 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLEVEL_GET_REQ, 0, NULL,0))
lh9ed821d2023-04-07 01:36:19 -070067 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070068 else{
69 *res_msg = at_err_build(ATERR_PROC_FAILED);
70 return AT_END;
71 }
lh9ed821d2023-04-07 01:36:19 -070072}
73
74int ext_LocknetList_get_func(char *at_paras, void ** res_msg)
75{
xf.li6236ea72023-07-26 04:58:33 -070076 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_GET_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
lh9ed821d2023-04-07 01:36:19 -070077 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070078 else{
79 *res_msg = at_err_build(ATERR_PROC_FAILED);
80 return AT_END;
81 }
lh9ed821d2023-04-07 01:36:19 -070082}
83
84int ext_LocknetAuth_func(char *at_paras, void ** res_msg)
85{
xf.li6236ea72023-07-26 04:58:33 -070086 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAUTH_REQ, 0, NULL,0))
lh9ed821d2023-04-07 01:36:19 -070087 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070088 else{
89 *res_msg = at_err_build(ATERR_PROC_FAILED);
90 return AT_END;
91 }
lh9ed821d2023-04-07 01:36:19 -070092}
93
94int ext_LocknetUnlockTimes_get_func(char *at_paras, void ** res_msg)
95{
xf.li6236ea72023-07-26 04:58:33 -070096 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCKTIMES_GET_REQ, 0, NULL,0))
lh9ed821d2023-04-07 01:36:19 -070097 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -070098 else{
99 *res_msg = at_err_build(ATERR_PROC_FAILED);
100 return AT_END;
101 }
lh9ed821d2023-04-07 01:36:19 -0700102}
103
104int ext_LocknetStatus_get_func(char *at_paras, void ** res_msg)
105{
xf.li6236ea72023-07-26 04:58:33 -0700106 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSTATUS_GET_REQ, 0, NULL,0))
lh9ed821d2023-04-07 01:36:19 -0700107 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -0700108 else{
109 *res_msg = at_err_build(ATERR_PROC_FAILED);
110 return AT_END;
111 }
lh9ed821d2023-04-07 01:36:19 -0700112}
113
114int ext_LocknetUnlock_func(char *at_paras, void ** res_msg)
115{
xf.li6236ea72023-07-26 04:58:33 -0700116 if(0 == ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCK_REQ,strlen(at_paras), (unsigned char *)at_paras,0))
lh9ed821d2023-04-07 01:36:19 -0700117 return AT_CONTINUE;
xf.li6236ea72023-07-26 04:58:33 -0700118 else{
119 *res_msg = at_err_build(ATERR_PROC_FAILED);
120 return AT_END;
121 }
lh9ed821d2023-04-07 01:36:19 -0700122}
123
124//ÊÕµ½zudryÖ÷¶¯Éϱ¨ÃüÁîºó£¬Ï·¢AT+ZSCHPLMN=1ʹmodemÔÊÐíËÑÍø(¸ÃÃüÁîÊÇÔÚËøÍø¹¦ÄÜÖÐʹÓÃ)
125int zurdy_auto_act(char *at_paras ,int is_query_report)
126{
127 int appmode = 0;
128 int initresult = 0;
129 void *p[2] = {&appmode, &initresult};
130
131 parse_param2("%d,%d", at_paras, p);
132 at_print(AT_ERR,"zurdy_auto_act appmode:%d,initresult:%d!\n",appmode,initresult);
133 if(appmode != 0 && (initresult == 30 || initresult == 31))
134 {
135 ipc_send_message(MODULE_ID_AT_CTL, MODULE_ID_LOCKNET, MSG_CMD_ZURDY_LOCKAUTH_REQ, 0, NULL,0);
136 }
137 return AT_END;
138}
139
140void ext_locknet_regist_init()
141{
142 register_serv_func("LOCKLISTAUTH=", MODULE_ID_LOCKNET, ext_LocklistAuth_func);
143 register_serv_func("LOCKNETLIST=", MODULE_ID_LOCKNET, ext_LocknetList_set_func);
144 register_serv_func("UNLOCKKEY=", MODULE_ID_LOCKNET, ext_LocknetKey_func);
145 register_serv_func("UNLOCKKEY?", MODULE_ID_LOCKNET, ext_LocknetAmtStatus_get_func);
146 register_serv_func("LOCKDIGEST?", MODULE_ID_LOCKNET, ext_LocknetDigest_get_func);
147 register_serv_func("LOCKSIGN=", MODULE_ID_LOCKNET, ext_LocknetSign_set_func);
148 register_serv_func("LOCKLEVEL?", MODULE_ID_LOCKNET,ext_LocknetLevel_get_func);
149 register_serv_func("MEPCG=", MODULE_ID_LOCKNET, ext_LocknetList_get_func);
150 register_serv_func("LOCKNETAUTH", MODULE_ID_LOCKNET, ext_LocknetAuth_func);
151 register_serv_func("ZNCK?", MODULE_ID_LOCKNET, ext_LocknetUnlockTimes_get_func);
152 register_serv_func("ZSEC?", MODULE_ID_LOCKNET, ext_LocknetStatus_get_func);
153 register_serv_func("ZNCK=", MODULE_ID_LOCKNET, ext_LocknetUnlock_func);
154
155 register_inform_func("ZURDY",zurdy_auto_act);
156}
157#endif
158