可以用任工的通信协议进行解析
This commit is contained in:
@ -8,8 +8,9 @@
|
||||
#include "stdlib.h"
|
||||
#include "cJSON_Test.h"
|
||||
#include "SerialDataProcess.h"
|
||||
|
||||
#include "Communication_Protocol.h"
|
||||
extern bool Printf_Flag ;
|
||||
uint8_t cjson_buf[200];
|
||||
void SerialDataProcess()
|
||||
{
|
||||
uint8_t len;
|
||||
@ -17,9 +18,15 @@ void SerialDataProcess()
|
||||
{
|
||||
len = g_usart_rx_sta & 0x3FFF; /* <20><>ȡ<EFBFBD><C8A1>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> */
|
||||
g_usart_rx_buf[len] = '\0'; /* ĩβ<C4A9><CEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
// printf("<EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD>JSON<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
||||
// printf(" %s\r\n",g_usart_rx_buf);
|
||||
cjson(g_usart_rx_buf);
|
||||
printf("<EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD>JSON<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
||||
printf(" %s\r\n",g_usart_rx_buf);
|
||||
|
||||
//IRIS_Cut_Befor_Header(g_usart_rx_buf,len);
|
||||
IRIS_Protocol_Unpack(g_usart_rx_buf, len, 0x00, cjson_buf);
|
||||
printf("<EFBFBD>и<EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s\r\n",cjson_buf);
|
||||
cjson(cjson_buf);
|
||||
//
|
||||
|
||||
g_usart_rx_sta = 0;
|
||||
memset(g_usart_rx_buf, 0, sizeof(g_usart_rx_buf));
|
||||
}else
|
||||
|
Reference in New Issue
Block a user