Commit 8b38084d authored by 时昊's avatar 时昊

feat:修改串口发送胎压值为不变不发,

parent 130280ba
......@@ -332,8 +332,23 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
Protocol_Send(0x12, ID12, 3);
}
// 函数定义
uint8_t arraysEqual(uint8_t arr1[], uint8_t arr2[], uint8_t size);
uint8_t arraysEqual(uint8_t arr1[], uint8_t arr2[], uint8_t size)
{
for (uint8_t i = 0; i < size; i++)
{
if (arr1[i] != arr2[i])
{
return 0; // 不相等,返回0(或false)
}
}
return 1; // 相等,返回1(或true)
}
extern uint8_t ID01[64];
extern uint8_t ID01_Len;
uint8_t ID01_Backup[64] = {0};
void Uart_Send_Id01_Pro(void)
{
uint8_t i = 0;
......@@ -363,18 +378,40 @@ void Uart_Send_Id01_Pro(void)
// //
// }
if ((ID01[24] == 0x28)&&(ID01[25] == 0xA8))
if(arraysEqual(ID01_Backup, ID01, 64) == 1)//相等
{
//printf("send 相等 \r\n");
}
else
{
Protocol_Send(0x01,ID01,ID01_Len);
memcpy(ID01_Backup, ID01, 64);
}
}
}
extern uint8_t Iphone_Num[20];
extern uint8_t number_length;
void Uart_Send_Id02_Pro(void)
{
uint8_t ID02[1] = {0x00};
uint8_t ID02[22] = {0x00};
uint8_t i = 0;
ID02[0] = BT_User.Call_Sts;
Protocol_Send(0x02, ID02, 1);//给底板发送电话状态,用这个标志位显示电话号
ID02[1] = number_length;
for ( i = 0; i < number_length; i++)
{
ID02[i+2] = Iphone_Num[i] - 0x30;
}
Protocol_Send(0x02, ID02, number_length+2);//给底板发送电话状态,用这个标志位显示电话号
//printf("电话长度:%x \r\n",number_length);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment