zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/app/zte_amt/amt_gps_test.c b/ap/app/zte_amt/amt_gps_test.c
new file mode 100644
index 0000000..d2be2dc
--- /dev/null
+++ b/ap/app/zte_amt/amt_gps_test.c
@@ -0,0 +1,124 @@
+/**
+ *
+ * @file amt_gps_test.c
+ * @brief
+ * This file is part of FTM.
+ * AMT´úÀíÓ¦Óòã
+ *
+ * @details
+ * @author Tools Team.
+ * @email
+ * @copyright Copyright (C) 2013 Sanechips Technology Co., Ltd.
+ * @warning
+ * @date 2019/02/02
+ * @version 1.1
+ * @pre
+ * @post
+ *
+ * @par
+ * Change History :
+ * ---------------------------------------------------------------------------
+ * date version author description
+ * ---------------------------------------------------------------------------
+ * 2015/04/28 1.0 lu.xieji Create file
+ * 2019/02/02 1.1 jiang.fenglin ÐÞ¸Ä×¢ÊÍ·½Ê½Îªdoxygen
+ * ---------------------------------------------------------------------------
+ *
+ *
+ */
+
+
+#include <sys/msg.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/types.h>
+#include <semaphore.h>
+#include <time.h>
+#include <sys/stat.h>
+#include "softap_api.h"
+#include "kwatch_msg.h"
+#include "amt.h"
+
+/**
+ * @brief AMT²âÊÔGPS³õʼ»¯
+ * @return ³É¹¦·µ»Ø0, ʧ°Ü·µ»Ø-1
+ * @note
+ * @see
+ */
+int Amt_Gps_Init(void)
+{
+ return 0;
+}
+
+
+/**
+ * @brief AMT´¦ÀíGPSÏûÏ¢º¯Êý
+ * @param[in] msg_id FID
+ * @param[in] msg_buf ½ÓÊÕÊý¾Ýbuffer
+ * @param[in] msg_len ½ÓÊÕÊý¾Ýbuffer³¤¶È
+ * @return ³É¹¦·µ»Ø0, ʧ°Ü·µ»Ø-1
+ * @note
+ * @see
+ */
+int Amt_Gps_ProcessMsg(unsigned int msg_id, unsigned char *msg_buf, unsigned int msg_len)
+{
+ UNUSED(msg_len);
+
+ switch(msg_id)
+ {
+ case FID_GPS_MODULE_TEST:
+ {
+ AmtPrintf(AMT_INFO "%s: MODULE_ID_AMT=%d,MODULE_ID_GPS=%d\n", __FUNCTION__,MODULE_ID_AMT,MODULE_ID_GPS);
+ AmtPrintf(AMT_INFO "%s: KWATCH_MSG_GPS_PWR_SET_REQ=%d\n", __FUNCTION__,KWATCH_MSG_GPS_PWR_SET_REQ);
+ unsigned char Flag = 0;
+ memcpy(&Flag,msg_buf,sizeof(unsigned char));
+ if(Flag == 1) //´ò¿ªgps
+ {
+ char buf[] = {"1"};
+ ipc_send_message2(MODULE_ID_AMT, MODULE_ID_GPS, KWATCH_MSG_GPS_PWR_SET_REQ, sizeof(buf), (unsigned char*)buf, 0);
+ }
+ else if(Flag == 0) //¹Ø±Õgps
+ {
+ char buf[] = {"0"};
+ ipc_send_message2(MODULE_ID_AMT, MODULE_ID_GPS, KWATCH_MSG_GPS_PWR_SET_REQ, sizeof(buf), (unsigned char*)buf, 0);
+ }
+ else
+ {
+ AmtPrintf(AMT_ERROR "%s: param error!\n", __FUNCTION__);
+ return -1;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
+/**
+ * @brief AMT·´À¡GPSÏûÏ¢¸øPC
+ * @param[in] msg_id FID
+ * @param[in] msg ÏûÏ¢Ìå
+ * @return ³É¹¦·µ»Ø0, ʧ°Ü·µ»Ø-1
+ * @note
+ * @see
+ */
+int Amt_Process_Gps_Rsp(MSG_BUF *msg, unsigned int msg_id)
+{
+ unsigned char *buf = msg->aucDataBuf;
+ AmtPrintf(AMT_INFO "%s: receive data= %s,datalen=%d.\n", __FUNCTION__,buf,msg->usDataLen);
+ if (Amt_CreateResponse(msg_id, buf, msg->usDataLen) == -1)
+ {
+ AmtPrintf(AMT_ERROR "%s: Send data failure.\n", __FUNCTION__);
+ }
+ else
+ {
+ AmtPrintf(AMT_INFO "%s: Send data success.\n", __FUNCTION__);
+ }
+ return 0;
+}
+