[Feature][S300][task-view-1920][locknet] before Implementation of enhanced network locking scheme

Change-Id: Ic7cd49e14c2c68fa1bf0041895918e6eac7737c3
diff --git a/lynq/S300/BJMTN/ap/lib/libatext/ext_locknet.c b/lynq/S300/BJMTN/ap/lib/libatext/ext_locknet.c
new file mode 100755
index 0000000..60fe04c
--- /dev/null
+++ b/lynq/S300/BJMTN/ap/lib/libatext/ext_locknet.c
@@ -0,0 +1,110 @@
+// #ifndef CONFIG_MIN_8M_VERSION

+#include "at_context.h"

+

+int ext_LocklistAuth_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKLISTAUTH_REQ,strlen(at_paras), (unsigned char *)at_paras,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetList_set_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetKey_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETKEY_REQ,strlen(at_paras), (unsigned char *)at_paras,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetAmtStatus_get_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAMTSTATUS_GET_REQ, 0, NULL,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetDigest_get_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETDIGEST_GET_REQ, 0, NULL,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetSign_set_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSIGN_SET_REQ,strlen(at_paras), (unsigned char *)at_paras,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetLevel_get_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLEVEL_GET_REQ, 0, NULL,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetList_get_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETLIST_GET_REQ,strlen(at_paras), (unsigned char *)at_paras,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetAuth_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETAUTH_REQ, 0, NULL,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetUnlockTimes_get_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCKTIMES_GET_REQ, 0, NULL,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetStatus_get_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETSTATUS_GET_REQ, 0, NULL,0);

+	return AT_CONTINUE;

+}

+

+int ext_LocknetUnlock_func(char *at_paras, void ** res_msg)

+{

+	ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_LOCKNET,MSG_CMD_LOCKNETUNLOCK_REQ,strlen(at_paras), (unsigned char *)at_paras,0);

+	return AT_CONTINUE;

+}

+

+//ÊÕµ½zudryÖ÷¶¯Éϱ¨ÃüÁîºó£¬Ï·¢AT+ZSCHPLMN=1ʹmodemÔÊÐíËÑÍø(¸ÃÃüÁîÊÇÔÚËøÍø¹¦ÄÜÖÐʹÓÃ)

+int zurdy_auto_act(char *at_paras ,int is_query_report)

+{

+    int appmode = 0;

+    int initresult = 0;

+    void *p[2] = {&appmode, &initresult};

+    

+    parse_param2("%d,%d", at_paras, p);

+    at_print(AT_ERR,"zurdy_auto_act appmode:%d,initresult:%d!\n",appmode,initresult);

+    if(appmode != 0 && (initresult == 30 || initresult == 31))

+    {   		

+		ipc_send_message(MODULE_ID_AT_CTL, MODULE_ID_LOCKNET, MSG_CMD_ZURDY_LOCKAUTH_REQ, 0, NULL,0);

+	}

+    return AT_END;

+}

+

+void ext_locknet_regist_init()

+{

+	register_serv_func("LOCKLISTAUTH=", MODULE_ID_LOCKNET, ext_LocklistAuth_func);

+	register_serv_func("LOCKNETLIST=", MODULE_ID_LOCKNET, ext_LocknetList_set_func);	

+	register_serv_func("UNLOCKKEY=", MODULE_ID_LOCKNET, ext_LocknetKey_func);

+	register_serv_func("UNLOCKKEY?", MODULE_ID_LOCKNET, ext_LocknetAmtStatus_get_func);

+	register_serv_func("LOCKDIGEST?", MODULE_ID_LOCKNET, ext_LocknetDigest_get_func);

+	register_serv_func("LOCKSIGN=", MODULE_ID_LOCKNET, ext_LocknetSign_set_func);

+	register_serv_func("LOCKLEVEL?", MODULE_ID_LOCKNET,ext_LocknetLevel_get_func);

+	register_serv_func("MEPCG=", MODULE_ID_LOCKNET, ext_LocknetList_get_func);

+	register_serv_func("LOCKNETAUTH", MODULE_ID_LOCKNET, ext_LocknetAuth_func);

+	register_serv_func("ZNCK?", MODULE_ID_LOCKNET, ext_LocknetUnlockTimes_get_func);

+	register_serv_func("ZSEC?", MODULE_ID_LOCKNET, ext_LocknetStatus_get_func);

+	register_serv_func("ZNCK=", MODULE_ID_LOCKNET, ext_LocknetUnlock_func);

+

+	register_inform_func("ZURDY",zurdy_auto_act);

+}

+// #endif

+