|
|
@ -38,6 +38,7 @@ void Paint_Thickness_intialize(struct UARTHandler *Handler) |
|
|
HardWareErrorController->Add_PCOMHardWare(HardWareErrorController,"PaintThickness_sensor",0,PaintThickness_sensor); |
|
|
HardWareErrorController->Add_PCOMHardWare(HardWareErrorController,"PaintThickness_sensor",0,PaintThickness_sensor); |
|
|
//uartHandler->Insert_HardWare_Entry_UART
|
|
|
//uartHandler->Insert_HardWare_Entry_UART
|
|
|
LOG("steering_engine_intialize"); |
|
|
LOG("steering_engine_intialize"); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint8_t Inquiry_Order_PT[6]={0X2E, 0X64, 0X30, 0X3C, 0X3A, 0X3E}; |
|
|
uint8_t Inquiry_Order_PT[6]={0X2E, 0X64, 0X30, 0X3C, 0X3A, 0X3E}; |
|
|
@ -53,18 +54,11 @@ void GF_PT_Inquiry() |
|
|
|
|
|
|
|
|
void decode_PaintThickness(uint8_t *buffer, uint16_t length) |
|
|
void decode_PaintThickness(uint8_t *buffer, uint16_t length) |
|
|
{ |
|
|
{ |
|
|
|
|
|
uint8_t data[2000]; |
|
|
|
|
|
memcpy(data,buffer,length); |
|
|
//memcpy(data_PaintThickness,buffer,length);
|
|
|
//memcpy(data_PaintThickness,buffer,length);
|
|
|
LOG("start decoding and the length is %d",length); |
|
|
LOG("start decoding and the length is %d",length); |
|
|
|
|
|
|
|
|
if(length >= PaintThickness_LastLength + 5) |
|
|
|
|
|
{ |
|
|
|
|
|
*PaintThickness_Count = *PaintThickness_Count + 1; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 校验 */ |
|
|
/* 校验 */ |
|
|
//;<:>
|
|
|
//;<:>
|
|
|
uint8_t crc_check[4] = {';','<',':','>'}; |
|
|
uint8_t crc_check[4] = {';','<',':','>'}; |
|
|
@ -75,6 +69,17 @@ void decode_PaintThickness(uint8_t *buffer, uint16_t length) |
|
|
&& crc_check[1] == buffer[length - 3] |
|
|
&& crc_check[1] == buffer[length - 3] |
|
|
&& crc_check[0] == buffer[length - 4]) |
|
|
&& crc_check[0] == buffer[length - 4]) |
|
|
{ |
|
|
{ |
|
|
|
|
|
//判断是否是新数据
|
|
|
|
|
|
if(length >= PaintThickness_LastLength + 5) |
|
|
|
|
|
{ |
|
|
|
|
|
*PaintThickness_Count = *PaintThickness_Count + 1; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int startIndex=0; |
|
|
int startIndex=0; |
|
|
|
|
|
|
|
|
for(int j=5;j<=14;j++) |
|
|
for(int j=5;j<=14;j++) |
|
|
|