From 46542e0df74f8ba6d1ef7e19a16a371f52afb230 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期一, 22 十月 2018 16:13:25 +0800
Subject: [PATCH] nothing

---
 源码/核心板/Src/application/serial_at_cmd_app.c |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/serial_at_cmd_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/serial_at_cmd_app.c"
index 4adc99f..5c6c8c6 100644
--- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/serial_at_cmd_app.c"
+++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/serial_at_cmd_app.c"
@@ -3,10 +3,10 @@
 #include <string.h>
 #include <stdio.h>
 #include "dw_app.h"
-
+#include "RTC.h"
 uint8_t m_frame_data[MAX_FRAME_LEN] = {0};
 uint8_t m_frame_data_len = 0;
-
+uint8_t g_pairstart=0;
 void ParseFrame(void)
 {
 	if(!memcmp(m_frame_data, "DIS1", 4))
@@ -87,6 +87,47 @@
 		Dw1000_App_Init();
 		printf("set dev id = %d. \r\n", g_com_map[DEV_ID]);
 		save_com_map_to_flash();
+	}else if(!memcmp(m_frame_data, "INT", 3))
+	{
+		g_com_map[COM_INTERVAL] = 0;
+		for(uint8_t i=4; i < m_frame_data_len; i++)
+		{
+			if(m_frame_data[i]<58 && m_frame_data[i]>47)
+			{
+				g_com_map[COM_INTERVAL] = g_com_map[COM_INTERVAL]*10 + m_frame_data[i]- '0';
+			}
+			else
+			{
+				printf("Error: Wrong COM_INTERVAL.\r\n");
+				break;
+			}
+		}
+		printf("set dev interval = %d ms. \r\n", g_com_map[COM_INTERVAL]);
+		RTC_Configuration(g_com_map[COM_INTERVAL]*20);
+		save_com_map_to_flash();
+	}else if(!memcmp(m_frame_data, "PAIRID", 6))
+	{
+		g_com_map[PAIR_ID] = 0;
+		for(uint8_t i=7; i < m_frame_data_len; i++)
+		{
+			if(m_frame_data[i]<58 && m_frame_data[i]>47)
+			{
+				g_com_map[PAIR_ID] = g_com_map[PAIR_ID]*10 + m_frame_data[i]- '0';
+			}
+			else
+			{
+				printf("Error: Wrong PAIR_ID.\r\n");
+				break;
+			}
+		}
+		printf("set dev PAIR_ID = %d . \r\n", g_com_map[PAIR_ID]);
+		save_com_map_to_flash();
+	}else if(!memcmp(m_frame_data, "STARTPAIR", 9))
+	{
+		g_pairstart=1;
+		printf("Start Pair Mode. \r\n");
+	}else{
+		printf("Error: Wrong Command.\r\n");
 	}
 }
 

--
Gitblit v1.9.3