[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/include/softap_api.h b/ap/app/include/softap_api.h
new file mode 100755
index 0000000..4025e2c
--- /dev/null
+++ b/ap/app/include/softap_api.h
@@ -0,0 +1,392 @@
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+/*! \mainpage
+ *
+ * <pre>
+ * ZX7520V3ƽ̨AP½Ó¿Ú£¬°üº¬ÒÔÏÂÍ·Îļþ£º
+ * softap_api.h£º ÉϲãÓ¦Óù«¹²Í·Îļþ£¬ÉϲãÓ¦Óÿª·¢°üº¬´ËÎļþ¼´¿É
+ * message.h£º    ¶¨ÒåÓ¦Óù«¹²ÏûÏ¢¶ÓÁÐkey, ÏûÏ¢Ìå, ÏûÏ¢ÃüÁîID, ·¢ËÍÏûÏ¢µÄAPI½Ó¿Ú
+ * softap_log.h£º ÉϲãÓ¦ÓÃlogÏà¹Ø½Ó¿Ú
+ * netapi.h£º     ÍøÂçÄ£¿é¶ÔÍ⹫¹²½Ó¿Ú
+ * cfg_api.h£º    AP²àÓ¦ÓÃNV¶Áд½Ó¿Ú
+ * soft_timer.h£º Èí¼þ¶¨Ê±Æ÷½Ó¿Ú
+ * rtc_timer.h:   rtc¶¨Ê±Æ÷½Ó¿Ú£¬ÊµÊ±¶¨Ê±Æ÷£¬»á»½ÐÑϵͳ
+ * at_msg.h£º     at_ctlÄ£¿éµÄÏûÏ¢idºÍÏûÏ¢½á¹¹¶¨Òå
+ * at_reg.h£º     at_ctlÄ£¿é¿Í»§¶ËºÍ·þÎñ¶Ë×¢²á½Ó¿Ú
+ * at_utils.h£º   at_ctlÄ£¿éÉú³ÉAT¶¯×÷Àà¡¢²éѯÀàÇëÇó¼°ÏìÓ¦½Ó¿Ú
+ * user_msg.h£º   AT¿Í»§¶Ë¡¢·þÎñ¶Ë¿ª·¢Ê¾Àý´úÂ룬½ö¹©²Î¿¼
+ * </pre>
+ */
+#endif
+
+/**
+ * @file softap_api.h
+ * @brief ÉϲãÓ¦Óù«¹²Í·Îļþ£¬ÉϲãÓ¦Óÿª·¢°üº¬´ËÎļþ¼´¿É
+ *
+ * Copyright (C) 2017 Sanechips Technology Co., Ltd.
+ * @author
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __SOFTAP_API_H__
+#define __SOFTAP_API_H__
+
+#include "os_type_def.h"
+#include "zxic_list.h"
+#include "cfg_api.h"
+#include "rtc_timer.h"
+#include "soft_timer.h"
+#include "wlan_interface.h"
+#include "zxic_errno.h"
+#include "netapi.h"
+#include "netioctl.h"
+#include "netotherapi.h"
+#include "at_reg.h"
+#include "at_utils.h"
+#include "at_msg.h"
+#include "at_pdp_api.h"
+#include "at_other_api.h"
+#include "sms_msg.h"
+#include "pb_msg.h"
+#include "mainctl_msg.h"
+#include "mmi_msg.h"
+#include "wifi_msg.h"
+#include "other_msg.h"
+#include "max_macro.h"
+#include <syslog.h>
+#include "softap_log.h"
+#include "audio_res_ctrl.h"
+#include "lq_msg.h"
+#include <sys/prctl.h>
+#include <sys/sysinfo.h>
+
+#define _GNU_SOURCE
+
+/**
+* @brief ¶¨ÒåÆ½Ì¨´íÎóÂë
+* 3GPP±ê×¼ATÃüÁîµÄ´íÎóÂ뷶Χ0-277, 6000-8000,¾ßÌå´íÎóÔ­Òò¿É²é¿´¡¶ZX297520V3ƽ̨ATÃüÁîÊÖ²á.doc¡·¸½Â¼A
+* @param AT_PARSE_OK				parse_param²ÎÊý½âÎöÕýÈ·
+* @param ATERR_ZXIC_ERR				ÖÐÐË΢оƬ·¢ÉúÒì³££¬ÇÒÎÞ·¨»Ö¸´£¬ÐèÒª½øÐÐÕû»úÖØÆô
+* @param ATERR_PARAM_INVALID		ÃüÁî²ÎÊýϸ½Ú²»¶Ô£¬Óë¾ßÌåATÃüÁî½ô¹ØÁª
+* @param ATERR_NOT_ALLOWED			Óë¾ßÌåÒµÎñÁ÷³Ì³åÍ»£¬²Ù×÷²»ÔÊÐí
+* @param ATERR_PROC_FAILED			ÃüÁî´¦Àíʧ°Ü£¬ÊôÓÚsoftapϵͳÒì³££¬ÈçÏûÏ¢·¢ËÍʧ°ÜµÈ
+* @param ATERR_DROP_MARK			Ë«ÒýºÅ¶ªÊ§Ò»¸ö£¬¿ÉÄÜÊǶª¶ººÅÔì³ÉµÄÆ«ÒÆ
+* @param ATERR_NO_PRINT				×Ö·û´®ÄÚÈÝ·ÇASCIIÃ÷ÎÄ£¬¿ÉÄÜÊǶª¶ººÅÔì³ÉµÄÆ«ÒÆ
+* @param ATERR_STR_TOO_LONG			ASCII×Ö·û´®¶ÁÈ¡µÄ³¤¶È³¬¹ý½âÎöÔ¼¶¨µÄ³¤¶È£¬¿ÉÄÜÊÇÍⲿÊäÈëµÄATÃüÁî²»ºÏ·¨
+* @param ATWARN_DROP_RN				ʵ¼Ê×Ö·û´®²ÎÊý¸öÊý´óÓÚfmt¸ñʽ»¯¸öÊý£¬¿ÉÄÜÊǵ÷ÓÃÕßÖ»¹ØÐIJ¿·Ö²ÎÊý£¬Ðè½÷É÷´¦Àí¸ÃºêÖµ
+* @param ATWARN_LACK_PARAM			°´ÕÕÈë²Î¸ñʽfmt½âÎö£¬ÄÚÈÝȱÉÙ²ÎÊý£¬ÓÉÓÚ²ÎÊý¿ÉÑ¡£¬¿ÉÄÜÊÇÕý³£µÄ£¬Ðè½÷É÷ʹÓøúêÖµ
+* @param ATERR_MEM_LESS				ÖÐÐË΢оƬÄÚ²¿ÄÚ´æ²»×ãÔì³ÉÎÞ·¨½ÓÊÕµ±Ç°ATÃüÁî
+* @param ATERR_WAIT_REQ_END_TIMEOUT	µÈ´ýÍⲿÊäÈëµÄREQÇëÇóÃüÁî½áÊø·û\r³¬Ê±
+* @param ATERR_WAIT_RSP_TIMEOUT		·¢ËÍÍêATÇëÇóºó£¬µÈ´ýÔ¶¶ËRSPÓ¦´ð½á¹û³¬Ê±
+* @param ATERR_CHANNEL_BUSY			µ±Ç°ATͨµÀÕýÔÚ´¦ÀíATÇëÇó£¬ÓÖÊÕµ½Ò»ÌõATÇëÇ󱨴í
+* @param ATERR_UNKNOWN_CMD			ÍⲿÊäÈëµÄÃüÁî²»¿Éʶ±ð£¬Îª·Ç·¨µÄATÃüÁî
+* @param ATERR_PARAM_CHECKSUM		¶ÔÓÚ½ÓÊÕµ½µÄATÃüÁî²ÎÊý½øÐÐchecksumУÑéʧ°Ü
+* @param ATERR_PPP_FILE_FAILED		PPPÎļþ²Ù×÷ʧ°Ü
+* @param ATERR_PPP_NOT_EXISTED		PPPD²»´æÔÚ
+* @param ATERR_PPP_WRONG_CHAN		PPPͨµÀ´íÎó
+* @param ATERR_PDP_IPADDR_FAILED	»ñÈ¡PDPµØÖ·Ê§°Ü
+* @param USER_EXTAND_ERR_BASE		³¬¹ý9000µÄΪÓëÍⲿMCUÏà¹ØµÄ¶¨ÖÆ´íÎóÂ룬ÐèÒªÍⲿMCUÓû§°´ÕÕ´íÎóÂë½øÐÐÏà¹ØÈÝ´í¶¯×÷
+*/
+enum SAP_ERR {
+    AT_PARSE_OK             = 0,      /*parse_param²ÎÊý½âÎöÕýÈ·*/
+    ATERR_ZXIC_ERR          = 8000,   /*ÖÐÐË΢оƬ·¢ÉúÒì³££¬ÇÒÎÞ·¨»Ö¸´£¬ÐèÒª½øÐÐÕû»úÖØÆô*/
+    ATERR_PARAM_INVALID     = 8001,   /*ÃüÁî²ÎÊýϸ½Ú²»¶Ô£¬Óë¾ßÌåATÃüÁî½ô¹ØÁª*/
+    ATERR_NOT_ALLOWED       = 8002,   /*Óë¾ßÌåÒµÎñÁ÷³Ì³åÍ»£¬²Ù×÷²»ÔÊÐí*/
+    ATERR_PROC_FAILED       = 8003,   /*ÃüÁî´¦Àíʧ°Ü£¬ÊôÓÚsoftapϵͳÒì³££¬ÈçÏûÏ¢·¢ËÍʧ°ÜµÈ*/
+    ATERR_DROP_MARK         = 8004,   /*Ë«ÒýºÅ¶ªÊ§Ò»¸ö£¬¿ÉÄÜÊǶª¶ººÅÔì³ÉµÄÆ«ÒÆ*/
+    ATERR_NO_PRINT          = 8005,   /*×Ö·û´®ÄÚÈÝ·ÇASCIIÃ÷ÎÄ£¬¿ÉÄÜÊǶª¶ººÅÔì³ÉµÄÆ«ÒÆ*/
+    ATERR_STR_TOO_LONG      = 8006,   /*ASCII×Ö·û´®¶ÁÈ¡µÄ³¤¶È³¬¹ý½âÎöÔ¼¶¨µÄ³¤¶È£¬¿ÉÄÜÊÇÍⲿÊäÈëµÄATÃüÁî²»ºÏ·¨*/
+    ATWARN_DROP_RN          = 8007,   /*ʵ¼Ê×Ö·û´®²ÎÊý¸öÊý´óÓÚfmt¸ñʽ»¯¸öÊý£¬¿ÉÄÜÊǵ÷ÓÃÕßÖ»¹ØÐIJ¿·Ö²ÎÊý£¬Ðè½÷É÷´¦Àí¸ÃºêÖµ*/
+    ATWARN_LACK_PARAM       = 8008,   /*°´ÕÕÈë²Î¸ñʽfmt½âÎö£¬ÄÚÈÝȱÉÙ²ÎÊý£¬ÓÉÓÚ²ÎÊý¿ÉÑ¡£¬¿ÉÄÜÊÇÕý³£µÄ£¬Ðè½÷É÷ʹÓøúêÖµ*/
+    ATERR_MEM_LESS          = 8009,   /*ÖÐÐË΢оƬÄÚ²¿ÄÚ´æ²»×ãÔì³ÉÎÞ·¨½ÓÊÕµ±Ç°ATÃüÁî*/
+    ATERR_WAIT_REQ_END_TIMEOUT = 8010, /*µÈ´ýÍⲿÊäÈëµÄREQÇëÇóÃüÁî½áÊø·û\r³¬Ê±*/
+    ATERR_WAIT_RSP_TIMEOUT  = 8011,   /*·¢ËÍÍêATÇëÇóºó£¬µÈ´ýÔ¶¶ËRSPÓ¦´ð½á¹û³¬Ê±*/
+    ATERR_CHANNEL_BUSY      = 8012,   /*µ±Ç°ATͨµÀÕýÔÚ´¦ÀíATÇëÇó£¬ÓÖÊÕµ½Ò»ÌõATÇëÇ󱨴í*/
+    ATERR_UNKNOWN_CMD       = 8013,   /*ÍⲿÊäÈëµÄÃüÁî²»¿Éʶ±ð£¬Îª·Ç·¨µÄATÃüÁî*/
+    ATERR_PARAM_CHECKSUM    = 8014,   /*¶ÔÓÚ½ÓÊÕµ½µÄATÃüÁî²ÎÊý½øÐÐchecksumУÑéʧ°Ü*/
+    ATERR_PPP_FILE_FAILED   = 8100,   /*PPPÎļþ²Ù×÷ʧ°Ü*/
+    ATERR_PPP_NOT_EXISTED   = 8101,   /*PPPD²»´æÔÚ*/
+    ATERR_PPP_WRONG_CHAN    = 8102,   /*PPPͨµÀ´íÎó*/
+    ATERR_PDP_IPADDR_FAILED = 8200,   /*»ñÈ¡PDPµØÖ·Ê§°Ü*/
+    USER_EXTAND_ERR_BASE    = 9000,   /*³¬¹ý9000µÄΪÓëÍⲿMCUÏà¹ØµÄ¶¨ÖÆ´íÎóÂ룬ÐèÒªÍⲿMCUÓû§°´ÕÕ´íÎóÂë½øÐÐÏà¹ØÈÝ´í¶¯×÷*/
+};
+
+
+/**
+ * @brief ´¦Àí×÷Ϊ·þÎñ¶ËµÄÊÕµ½µÄÇëÇóÃüÁî¡£at_parasΪATÃüÁî²ÎÊýÊ×µØÖ·£¬rsp_cmdΪӦ´ð½á¹û×Ö·û´®£¬×÷Ϊ³ö²Î´æÔÚ£»Ò»°ãµÄ£¬Óû§ÔڸýӿڵľßÌåʵÏÖʱ£¬
+ * ÄÚ²¿µ÷ÓÃparse_param½Ó¿Ú½øÐвÎÊý½âÎö£¬²¢¸ù¾Ý·µ»ØÖµ½øÐвÎÊýÓÐЧÐÔ¼ì²é£¬ÒÔ·ÀÖ¹ÍⲿMCUÓëZXICоƬ¼äµÄÎïÀí´®¿ÚͨÐÅÒì³£Ôì³ÉATÃüÁîÊý¾Ý´íÎó¡£
+ * ¶ÔÓÚͬ²½Ó¦´ðÀ©Õ¹ATÇëÇ󣬱ØÐëÔÚ½Ó¿ÚÄÚ²¿Îªrsp_cmdÉêÇëÄÚ´æ¿Õ¼ä£¬²¢¸³ÖµÖмäÉϱ¨ºÍ½á¹ûÂ룬²¢·µ»ØAT_END£»
+ * ¶ÔÓÚÐèÒª·¢Ë͸ø¿Í»§Ó¦Óýø³Ì½øÐд¦ÀíµÄ£¬Óɿͻ§ÔÚ×¢²áº¯ÊýÄÚ²¿½øÐÐÒì²½½»»¥£¬²¢·µ»ØAT_CONTINUE,atctlÖ÷¿Ø×èÈûµ±Ç°ATͨµÀ£»Ö±µ½Óû§½ø³Ìµ÷ÓÃ
+ * send_rsp_str_to_farps½Ó¿Ú½«Ó¦´ð½á¹û·¢Ë͸øatctl£¬ÔÙÓÉatctl·¢Ë͸øÍⲿMCU£¬²¢ÊÍ·ÅATͨµÀ
+ * @param res_msg		 µ±ÊÇͬ²½Ó¦´ð·½Ê½Ê±£¬Èô*res_msg²»ÎªNULL£¬ÔòÄÚÈÝΪӦ´ð½á¹ûÂ룬ÓÉat_ctl·¢Ë͸øÍⲿMCUºóÊÍ·ÅATͨµÀ£»
+ 						 Èô*res_msgΪNULL£¬ÓÉat_ctlÖ±½Ó»Ø¸´\r\nOK\r\n·¢Ë͸øÍⲿMCUºóÊÍ·ÅATͨµÀ
+ *						 µ±ÊÇÓ¦Óýø³ÌÒì²½·½Ê½´¦Àíʱ£¬*res_msg±ØÐëΪNULL£¬´Ëʱ»á³¤Ê±¼ä¶ÂÈûסATͨµÀ£¬Ö±ÖÁÓû§½ø³Ìµ÷ÓÃsend_rsp_str_to_farps½Ó¿Ú½â×èÈûATͨµÀ
+ * @return intÐͽá¹ûÂ룬AT_END±íʾͬ²½Ó¦´ð·½Ê½£»AT_CONTINUE±íʾÒì²½Ó¦´ð·½Ê½£¬ÐèÒªÓ¦Óýø³ÌÒì²½½»»¥
+ * @note
+ */
+typedef int (*ser_req_func)(char *at_paras, void ** res_msg);
+
+/**
+ * @brief ¶ÔÓÚÉϱ¨atÃüÁî´¦Àíº¯Êý£¬°üº¬²éѯÖмä½á¹ûºÍÖ÷¶¯Éϱ¨µÄatÃüÁî´¦Àí
+ *	¶ÔÓÚpsÏà¹ØµÄÖ÷¶¯Éϱ¨ºÍ²éѯÖмä½á¹ûÉϱ¨£¬Ò»°ãÎÞÐ轫Éϱ¨ÄÚÈÝ·¢Ë͸øÆäËûÄ£¿éÓ¦Óã¬Òò´Ë¾¡Á¿Ê¹ÓÃnvºÍÈ«¾Ö±äÁ¿µÄ·½Ê½´æ·Å
+ *	¶ÔÓÚÀ©Õ¹atµÄÖмä½á¹ûÉϱ¨£¬Ò»°ãÐèÒª½«²éѯ½á¹û·¢Ë͸øÆäËûÄ£¿éÓ¦Ó㬶¯Ì¬ÉêÇëÄڴ棬·ÅÔÚcontextÉÏÏÂÎÄÖеÄapp_para±äÁ¿ÖÐ
+ * @param at_paras	ATÃüÁî×Ö·û´®
+ * @param is_query_report
+ * @return intÐÍ×Ö·û´®
+ */
+
+typedef int (*inform_act_func)(char *at_paras, int is_query_report);
+
+
+/**
+* @brief ½ø³Ì¼äͨÐÅÏûÏ¢·¢Ëͽӿڣ¬Èç¹ûÏûÏ¢¶ÓÁÐδ´´½¨£¬·µ»ØÊ§°ÜֵΪ-1
+* @param source_id(IN)	:ÏûÏ¢·¢ËÍÄ£¿éID
+* @param target_id(IN)	:ÏûÏ¢½ÓÊÕÄ£¿éID
+* @param Msg_cmd(IN)  	:ÏûÏ¢ÃüÁÓÃÓÚ½ÓÊÕÄ£¿é´¦ÀíÏûϢʱ£¬È·¶¨ÏûÏ¢´¦ÀíµÄ·½Ê½
+* @param us_DataLen(IN)	:ÏûÏ¢ÖÐЯ´øÊý¾ÝµÄ³¤¶È
+* @param pData(IN)		:ÏûÏ¢ÖÐЯ´øµÄÊý¾ÝÄÚÈÝ
+* @param msgflag(IN)		:ÏûÏ¢µÄ·¢ËÍ·½Ê½£¬0±íʾ×èÈû·¢ËÍ£¬IPC_NOWAIT±íʾ·Ç×èÈû·¢ËÍ
+* @return ·¢Ëͳɹ¦·µ»Ø0£¬·¢ËÍʧ°Ü·µ»Ø·Ç0£¬¾ßÌå´íÎóÀàÐÍÇë²Î¿¼linux±ê×¼µÄerrnoÀàÐÍ
+* @note ·¢ËÍʧ°Ü£¬Ó¦ÓÃÅжÏerrno == ENOENT, ±íʾ¶ÓÁÐÂú£»Èô½ÓÊÕ·½Ò»¶¨»á±»Æô¶¯£¬·¢ËÍ·½¿É¼ÌÐøµ÷ÓÃipc_send_msg2½Ó¿Ú
+*/
+int ipc_send_message(int src_id, int dst_id, unsigned short Msg_cmd, unsigned short us_DataLen, unsigned char *pData, int msgflag);
+
+/**
+* @brief ½ø³Ì¼äͨÐÅÏûÏ¢·¢Ëͽӿڣ¬Èç½ÓÊÕÓ¦ÓÃÒ»¶¨»áÆô¶¯Ê±£¬·¢ËÍ·½µ÷Óøýӿڣ¬Èç¹ûÏûÏ¢¶ÓÁÐδ´´½¨£¬»á×Ô¶¯´´½¨ÏûÏ¢¶ÓÁÐ
+* @param source_id(IN)	:ÏûÏ¢·¢ËÍÄ£¿éID
+* @param target_id(IN)	:ÏûÏ¢½ÓÊÕÄ£¿éID
+* @param Msg_cmd(IN)  	:ÏûÏ¢ÃüÁÓÃÓÚ½ÓÊÕÄ£¿é´¦ÀíÏûϢʱ£¬È·¶¨ÏûÏ¢´¦ÀíµÄ·½Ê½
+* @param us_DataLen(IN)	:ÏûÏ¢ÖÐЯ´øÊý¾ÝµÄ³¤¶È
+* @param pData(IN)		:ÏûÏ¢ÖÐЯ´øµÄÊý¾ÝÄÚÈÝ
+* @param msgflag(IN)		:ÏûÏ¢µÄ·¢ËÍ·½Ê½£¬0±íʾ×èÈû·¢ËÍ£¬IPC_NOWAIT±íʾ·Ç×èÈû·¢ËÍ
+* @return ·¢Ëͳɹ¦·µ»Ø0£¬·¢ËÍʧ°Ü·µ»Ø·Ç0£¬¾ßÌå´íÎóÀàÐÍÇë²Î¿¼linux±ê×¼µÄerrnoÀàÐÍ
+* @note ´Ë½Ó¿ÚÓÃÓÚÏûÏ¢²»×¼¶ªÊ§µÄ³¡¾°£¬¼´: Ä¿±êÓ¦ÓÃÒ»¶¨»áÆô¶¯´¦Àí´ËÏûÏ¢£¬µ«ÓÐʱ´æÔÚ·¢ËÍÏûϢʱĿ±êÓ¦ÓÃÉÐδÆô¶¯
+*       Èç: ¿ª»ú³õʼ»¯Ê±Ò»Ð©ÌØÊâÏûÏ¢ÈçÈȲå°ÎʼþÉϱ¨¶ø½ÓÊÕÓ¦ÓÃÉÐδÆô¶¯£¬½ÓÊÕ¶ÓÁÐÉÐδ´´½¨
+*/
+int ipc_send_message2(int src_id, int dst_id, unsigned short Msg_cmd, unsigned short us_DataLen, unsigned char *pData, int msgflag);
+
+
+/**
+ * @brief ATÃüÁî½âÎö½Ó¿Ú
+ * @param fmt ATÇëÇó»òÏìÓ¦µÄ¸ñʽ»¯·½Ê½
+ * @param buf  ATÇëÇó»òÏìÓ¦µÄ×Ö·û´®Ö¸Õë²»º¬Í·²¿ºÍ¿Õ¸ñ
+ * @param pval	¸ñʽ»¯ºóµÄATÃüÁî
+ * @return 0±íʾ½âÎö²ÎÊýÕý³££¬²»½øÐвÎÊý¸öÊýµÄÓÐЧÐÔ¼ì²é£¬¾ßÌå·µ»ØÖµ²Î¿´¸ÃÍ·ÎļþSAP_ERRö¾ÙÀàÐÍÖÐAT_PARSE_OKµÈºêÖµ
+ * @note  
+ * 1. ½âÎöµÄATÃüÁî±ØÐë°´ÕÕ3GPP27007±ê׼ЭÒ飬²ÎÊýÒÔ¶ººÅ¸ô¿ª£¬×Ö·û´®Ðè´øË«ÒýºÅ£¬·ñÔò»á¶ÏÑÔ
+ * 2. ×Ö·û´®½âÎöʱµÄÈë²Î³¤¶È±ØÐë´óÓÚ¿ÉÄܽâ³öµÄ×Ö·û´®³¤¶È£¬·ñÔò»áÔ½½ç
+ * 3. ·µ»ØÖµÇë²Î¿¼Ã¶¾Ùenum SAP_ERR,²»½øÐвÎÊý¸öÊýµÄÓÐЧÐÔ¼ì²é
+ * 4. ÈôfmtÖ¸¶¨µÄ²ÎÊýÀàÐͱØÐëÓëpvalÖÐÖ¸ÕëµÄÒ»Ò»¶ÔÓ¦
+ * 5. ʾÀý
+<pre>
+	char buf[]="1,2,\"test\"";
+	int n1 = 0;
+	int n2 = 0;
+	char *n3 = malloc(strlen(buf));
+	char *p[] = {&n1,&n2,n3};
+	ret = parse_param("%d,%d,%s", buf, (void**)p);
+	//½âÎöºón1==1 n2==2 n3=="test"	 
+	ret = parse_param("%4d,%d,%3s", buf, (void**)p);
+	//½âÎöºón1==1 n2==2 n3=="te"	 
+</pre>
+ * @warning 
+ */
+int  parse_param(char *fmt, char *buf, void **pval);
+
+
+/**
+ * @brief Ó¦Ó÷¢ËͶ¯×÷Àà»ò²éѯÀàATÇëÇó¸ø3GPPЭÒéÕ»£¬²¢×èÈûµÈ´ý¶¯×÷½á¹û£»×¢Ò⣺¸Ã½Ó¿ÚÖ»ÄÜÓÃÓÚ²éѯºÍÉèÖúÍÖ´ÐÐÇëÇó£¬Í¨¹ýÈë²Î½øÐÐÖмä½á¹ûµÄÄÚ²¿½âÎö´¦Àí£¬²¢ÇÒ
+		  ÓÐÖмä½á¹ûÉϱ¨Ê±£¬Ö»Ö§³ÖÒ»ÌõÖмä½á¹ûµÄÉϱ¨½âÎö£»
+ * @param req_at  ÇëÇóATÃüÁ´óСдÃô¸Ð£¬±ØÐë´óд
+ * @param info_fmt ATÏìÓ¦µÄ¸ñʽ»¯·½Ê½
+ * @param pval	¸ñʽ»¯ºóµÄATÏìÓ¦£¬¾ßÌåʹÓòο´parse_param½Ó¿Ú
+ * @return 0±íʾ·µ»Ø³É¹¦£¬ÆäËûÖµ±íʾʧ°Ü´íÎóÂë
+ * @note  
+ * 1. Óû§Ê¹ÓÃʱ£¬Èô²»ÏëÓɸýӿÚÄÚ²¿½øÐвÎÊýµÄ¸ñʽ»¯½âÎö£¬¿ÉÒÔ½«info_fmt¸³ÖµÎª"%s"£¬pval¸³ÖµÎªchar **p˫ָÕ룬ÕâÑù²ÎÊý½«×÷ΪÕûÌå×Ö·û´®·µ»Ø¸øµ÷ÓÃÕß
+ * 2. ¶ÔÓÚZMGL,CPBR, COPS=?µÈÒ»ÌõÇëÇó»áÓжàÌõÖмä½á¹ûÇé¿ö£¬¸Ãº¯Êý²»ÊÊÓÃ
+ * 3. ×Ö·û´®½âÎöʱµÄÈë²Î³¤¶È±ØÐë´óÓÚ¿ÉÄܽâ³öµÄ×Ö·û´®³¤¶È£¬·ñÔò»áÔ½½ç
+ * 4. µ±´æÔÚÖмäÉϱ¨Ê±£¬pvalºÍinfo_fmt²»Îª¿Õ£»µ±ÎªÖмäÉϱ¨Ê±£¬Á½¸ö±ØÐë½ÔΪ¿Õ
+ * 5. pvalºÍinfo_fmtÁ½ÕßҪô¶¼ÎªNULL,Ҫô¶¼²»ÎªNULL£¬²»ÄÜ´æÔÚÆäÖÐÒ»¸öΪNULL£¬ÁíÒ»¸ö²»ÎªNULLµÄÇé¿ö
+ * 6. ʾÀý
+<pre>
+	int ret = 0;
+	ret = get_modem_info("AT+CFUN=1\r", NULL,  NULL);
+	//·µ»Ø¼´±íʾִÐгɹ¦
+
+	char *pstr = malloc(50);
+	memset(pstr,0,50);
+	ret = get_modem_info("AT+CIMI\r", "%s",  (void**)&pstr);
+	//·µ»Øºópstr==111111111111111
+
+	int n1 = 0;
+	int n2 = 0;
+	int n3 = 0;
+	char *p2[] = {&n1,&n2,&n3};
+	ret = get_modem_info("AT+CCIOTOPT?\r", "%d,%d,%d",	(void**)p2);
+	//+CCIOTOPT: 1,2,3½âÎöºón1==1 n2==2 n3==3
+</pre>
+ * @warning 
+ */
+int  get_modem_info(char *req_at,char *info_fmt,void **pval);
+
+
+/**
+ * @brief Ó¦Ó÷¢ËͶ¯×÷Àà»ò²éѯÀàATÇëÇó¸øÍⲿMCU£¬²¢×èÈûµÈ´ý¶¯×÷½á¹û£¬Ö»Ö§³ÖÒ»ÌõÖмä½á¹ûµÄÉϱ¨½âÎö£»
+ * ÓÉÓÚ´®¿ÚͨÐÅ´æÔÚ¶ªÊý¾Ý¿ÉÄÜ£¬¼ì²âµ½ÖмäÉϱ¨»òÓ¦´ð½á¹ûÓдíÎóʱ£¬»á½øÐÐÖØ·¢³¢ÊÔ£¬Ä¿Ç°ÖØ·¢3´Îºó»á¶ÏÑÔ£»
+ * À©Õ¹ATÃüÁÒåµÄ´íÎóÂ볬¹ý9000£¬²»½øÐÐÖØ·¢³¢ÊÔ
+ * @param req_at  ÇëÇóATÃüÁ´óСдÃô¸Ð£¬±ØÐë´óд
+ * @param len     ÇëÇóATÃüÁîµÄ³¤¶È
+ * @param info_fmt ATÏìÓ¦µÄ¸ñʽ»¯·½Ê½
+ * @param pval	¸ñʽ»¯ºóµÄATÏìÓ¦£¬£¬¾ßÌåʹÓòο´parse_param½Ó¿Ú
+ * @param safe_parm_check	ָʾÊÇ·ñ¶Ô²ÎÊý¸öÊý½øÐÐÒ»ÖÂÐÔ¼ì²é£¬0±íʾº¬¿ÉÑ¡²ÎÊý£¬²»¶Ô²ÎÊý¸öÊý½øÐмì²é;1±íʾ¶Ô²ÎÊý¸öÊý½øÐÐÑϸñ¼ì²é
+ * @param timeout timeout==0 ±íʾÓÀ¾ÃµÈ´ý½á¹ûÂ룬·ñÔòµÈ´ýʱ¼äΪ[timeout]Ãë
+ * @return 0±íʾ·µ»Ø³É¹¦£¬ÆäËûÖµ±íʾʧ°Ü´íÎóÂë
+ * @note  
+ * 1. Óû§Ê¹ÓÃʱ£¬Èô²»ÏëÓɸýӿÚÄÚ²¿½øÐвÎÊýµÄ¸ñʽ»¯½âÎö£¬¿ÉÒÔ½«info_fmt¸³ÖµÎª"%s"£¬pval¸³ÖµÎªchar **p˫ָÕ룬ÕâÑù²ÎÊý½«×÷ΪÕûÌå×Ö·û´®·µ»Ø¸øµ÷ÓÃÕß
+ * 2. ¶ÔÓÚZMGL,CPBR, COPS=?µÈÒ»ÌõÇëÇó»áÓжàÌõÖмä½á¹ûÇé¿ö£¬¸Ãº¯Êý²»ÊÊÓÃ
+ * 3. ×Ö·û´®½âÎöʱµÄÈë²Î³¤¶È±ØÐë´óÓÚ¿ÉÄܽâ³öµÄ×Ö·û´®³¤¶È£¬·ñÔò»áÔ½½ç
+ * 4. µ±´æÔÚÖмäÉϱ¨Ê±£¬pvalºÍinfo_fmt²»Îª¿Õ£»µ±ÎªÖмäÉϱ¨Ê±£¬Á½¸ö±ØÐë½ÔΪ¿Õ
+ * 5. pvalºÍinfo_fmtÁ½ÕßҪô¶¼ÎªNULL,Ҫô¶¼²»ÎªNULL£¬²»ÄÜ´æÔÚÆäÖÐÒ»¸öΪNULL£¬ÁíÒ»¸ö²»ÎªNULLµÄÇé¿ö
+ * 6. ʾÀý
+<pre>
+	int ret = 0;
+	ret = send_reqat_to_farps("AT+CFUN=1\r", NULL,  NULL, 0);
+	//·µ»Ø¼´±íʾִÐгɹ¦
+
+	char *pstr = malloc(50);
+	memset(pstr,0,50);
+	ret = send_reqat_to_farps("AT+CIMI\r", "%3s",  (void**)&pstr, 3000);
+	//·µ»Øºópstr==111111111111111, pstrÖÐ×Ö·ûÊýÄ¿×î´óΪ2
+
+	int n1 = 0;
+	int n2 = 0;
+	int n3 = 0;
+	char *p2[] = {&n1,&n2,&n3};
+	ret = send_reqat_to_farps("AT+CCIOTOPT?\r", "%d,%d,%d",	(void**)p2, 5000);
+	//+CCIOTOPT: 1,2,3½âÎöºón1==1 n2==2 n3==3,×î´óµÈʱ¼äΪ5000ms
+</pre>
+ * @warning 
+ */
+int  send_reqat_to_farps(char *req_at,int len,char *info_fmt,void **pval, int safe_parm_check, int timeout);
+
+
+/**
+ * @brief ÓÃÓÚ¿ª»ú×¢²áËùÓеķþÎñ¶Ë¾ßÌåATÃüÁîʼþ£¬³£ÓÃÓÚÉϲ㼰¿Í»§¶¨ÖÆ£¬²»×¼ÓÃÓÚPSЭÒéÕ»¡£
+ * @param at_cmd_prefix	 ATÃüÁîǰ׺ָÕë
+ * @param module_id      Ô´Ä£¿é¶ÓÁÐid
+ * @param req_rcv_act    ¾ßÌ庬Òå²Î¼ûtypedef int (*ser_req_func)(char *at_paras, void ** res_msg)½Ó¿Ú˵Ã÷
+ * @return intÐͽá¹ûÂë
+ * @retval ³É¹¦ 0
+ * @note ¸Ã×¢²áº¯ÊýÓëregister_serv_func2µÄÇø±ðÊÇÈë²ÎÖ»ÓÐat_cmd_prefix¡¢module_idºÍreq_rcv_act
+ *  at_ctlÊÕµ½ATÃüÁîºó£¬µ÷ÓÃ×¢²áµÄreq_rcv_act£¬at_ctlÄÜ·µ»Ø´¦Àí½á¹û£¬Ö±½Ó½«½á¹ûÂë·¢Ë͸øÍⲿMCU£¬
+ ·ñÔò£¬ÊÕµ½Íⲿ·¢Ë͵ÄATÇëÇó£¬Í¨¹ýÏûÏ¢MSG_CMD_SEND_REQ_TO_APP·¢Ë͸øÓ¦Ó㬠
+ Ó¦Óô¦Àíºóͨ¹ýµ÷Óú¯Êýsend_rsp_str_to_farps£¬ÓÉat_ctl½«Ó¦´ð½á¹û·¢Ë͵½ÍⲿMCU
+ */
+int  register_serv_func(char *at_cmd_prefix, int  module_id, ser_req_func req_rcv_act);
+
+
+/**
+ * @brief ×¢²áÉϱ¨ATÃüÁîµÄʼþ´¦Àí£¬°üÀ¨²éѯÖмä½á¹ûÉϱ¨ºÍÖ÷¶¯Éϱ¨¡£
+ * @param at_cmd_prefix	 ATÃüÁîǰ׺ָÕë
+ * @param inform_act     ½ÓÊÕµ½ATÃüÁîÖмä½á¹ûºÍÖ÷¶¯Éϱ¨ºóµÄ´¦Àíº¯Êý
+ * @return intÐͽá¹ûÂë
+ * @retval ³É¹¦ 0, ʧ°Ü -1
+ * @note ÏàͬµÄÃüÁîǰ׺¿ÉÒÔÖØ¸´×¢²á¶à¸ö£¬at_ctl¿ò¼ÜÔÚÊÕµ½Ö÷¶¯Éϱ¨»òÖмä½á¹ûʱ£¬±éÀúÁ´±í£¬Ã¿¸öÖ´Ðк¯Êý¶¼»áÖ´ÐÐÒ»±é¡£
+ * ÕâÑù£¬Èç¹ûÊÇÖмä½á¹û£¬¾Í¿ÉÄܱ»µ±³ÉÖ÷¶¯Éϱ¨Éϱ¨¸øÓ¦Óã¬ÓÉÓ¦ÓùýÂËÎÞЧµÄÖ÷¶¯Éϱ¨ÏûÏ¢
+ */
+int  register_inform_func(char *at_cmd_prefix, inform_act_func inform_act);
+
+
+/**
+  * @brief ·þÎñ¶ËÓ¦ÓóÌÐò£¬·¢ËÍÖмä½á¹ûºÍÏìÓ¦µ½ÍⲿMCU
+  * @param module_id	  Ó¦ÓÃÄ£¿é¶ÓÁÐid
+  * @param rsp_cmd		  ´ý·¢Ë͵½ÍⲿMCUµÄÊý¾Ý
+  * @param rsp_len		  ÃüÁ¶È
+  * @return intÐͽá¹ûÂë
+  * @retval ³É¹¦ 0, ʧ°Ü -1
+  * @note 
+  */
+int send_rsp_str_to_farps(int	module_id, char *rsp_cmd,int rsp_len);
+
+
+/**
+ * @brief Éú³ÉatÏìÓ¦½á¹ûERRORº¯Êý
+ * @param param  ERRORµÄ´íÎóÂë
+ * @return atÏìÓ¦½á¹ûERROR×Ö·û´®µÄÖ¸Õë
+ * @note ÓÉat_ctl¸ºÔðÊÍ·ÅÄÚ´æ
+ */
+char* at_err_build(int param);
+
+/**
+ * @brief ·¢Æð¹Ø»úÇëÇó
+ * @param src_id ·¢Æð·½Ä£¿éid£¬Î´ÉêÇë¿ÉÒÔÌî0
+ * @return ·¢Ëͽá¹û£¬0³É¹¦£¬·Ç0ʧ°Ü
+ */
+int poweroff_request(int src_id);
+
+/**
+ * @brief ·¢ÆðÖØÆôÇëÇó
+ * @param src_id ·¢Æð·½Ä£¿éid£¬Î´ÉêÇë¿ÉÒÔÌî0
+ * @return ·¢Ëͽá¹û£¬0³É¹¦£¬·Ç0ʧ°Ü
+ */
+int restart_request(int src_id);
+
+/**
+ * @brief ·¢Æð»Ö¸´³ö³§ÉèÖÃÇëÇó
+ * @param src_id ·¢Æð·½Ä£¿éid£¬Î´ÉêÇë¿ÉÒÔÌî0
+ * @return ·¢Ëͽá¹û£¬0³É¹¦£¬·Ç0ʧ°Ü
+ */
+int reset_request(int src_id);
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+/**
+* @brief ½ø³Ì¼äͨÐÅÏûÏ¢·¢ËͽӿÚ
+* @param position(IN)	:ÏûÏ¢·¢ËÍ·½Ïò
+* @param msg_cmd(IN)	:ÏûÏ¢ÃüÁÓÃÓÚ½ÓÊÕÄ£¿é´¦ÀíÏûϢʱ£¬È·¶¨ÏûÏ¢´¦ÀíµÄ·½Ê½
+* @param len(IN)  	    :ÏûÏ¢¶ÔÓ¦½á¹¹ÌåÊý¾Ý³¤¶È
+* @param msg(IN)	 	:ÏûÏ¢¶ÔÓ¦½á¹¹ÌåÊý¾Ý
+* @return ·¢Ëͳɹ¦·µ»Ø0£¬·¢ËÍʧ°Ü·µ»Ø·Ç0£¬¾ßÌå´íÎóÀàÐÍÇë²Î¿¼linux±ê×¼µÄerrnoÀàÐÍ
+* @note Éæ¼°ºË¼õÏûÏ¢´«µÝ£¬½öÄÚ²¿Ê¹Óá£
+*/
+int send_soc_msg(unsigned short position, int dst_id, unsigned short msg_cmd, unsigned short len, void *msg);
+
+/**
+* @brief ½ø³Ì¼äͨÐż°ºË¼äͨÐÅÏûÏ¢·¢ËÍͨÓýӿÚ
+* @param src_id(IN)		:ÏûÏ¢·¢ËÍÄ£¿éID
+* @param dst_id(IN)		:ÏûÏ¢½ÓÊÕÄ£¿éID
+* @param msg_cmd(IN)	:ÏûÏ¢ÃüÁÓÃÓÚ½ÓÊÕÄ£¿é´¦ÀíÏûϢʱ£¬È·¶¨ÏûÏ¢´¦ÀíµÄ·½Ê½
+* @param datalen(IN)	:ÏûÏ¢¶ÔÓ¦½á¹¹ÌåÊý¾Ý³¤¶È
+* @param pData(IN)		:ÏûÏ¢¶ÔÓ¦½á¹¹ÌåÊý¾Ý
+* @return ·¢Ëͳɹ¦·µ»Ø0£¬·¢ËÍʧ°Ü·µ»Ø·Ç0£¬¾ßÌå´íÎóÀàÐÍÇë²Î¿¼linux±ê×¼µÄerrnoÀàÐÍ
+* @note Éæ¼°ºË¼õÏûÏ¢´«µÝ£¬½öÄÚ²¿Ê¹Óá£
+*/
+int platform_send_msg(int src_id, int dst_id, unsigned short msg_cmd, unsigned short datalen, unsigned char *pData);
+
+/**
+* @brief   ƽ̨ÄÚ´íÎó¸ú×Ù
+* @param   err(IN):
+* @return
+*/
+void zxic_err_track(int err);
+
+/**
+* @brief    ¼ì²éĬÈÏ·ÓÉÊÇ·ñÅäÖóɹ¦
+* @return  ÅäÖóɹ¦·µ»Ø1, ²»³É¹¦·µ»Ø-1
+*/
+int default_route_check();
+
+extern long long int get_time_us();
+
+extern int soft_system(const char *command);
+
+#endif
+
+/**
+*brief 	»ñȡϵͳÆô¶¯Ê±¼ä
+*return ·µ»ØÏµÍ³×Ô¿ª»úµ½ÏÖÔÚµÄʱ¼ä¼ä¸ô£¬µ¥Î»ÎªÃë
+*/
+long get_sys_uptime();
+
+#endif