Commit 7551ea2a authored by 时昊's avatar 时昊

feat:修改胎压模块

parent d2470ea8
......@@ -337,33 +337,36 @@ extern uint8_t ID01_Len;
void Uart_Send_Id01_Pro(void)
{
uint8_t i = 0;
//if(Ble_User.Tpms_Updat)
{
// ID01[0] = Ble_Tpms_Data.Tpms_Sts;
// ID01[1] = Ble_Tpms_Data.Tpms_Turn;
// ID01[2] = Ble_Tpms_Data.Tpms_Dte[0];
// ID01[3] = Ble_Tpms_Data.Tpms_Dte[1];
// ID01[4] = Ble_Tpms_Data.Tpms_Dte[2];
// ID01[5] = Ble_Tpms_Data.Tpms_Dte[3];
// printf("ID01_Len = %d\r\n",ID01_Len);
for(i = 0; i < ID01_Len; i++)
{
//ID01[i] = scan_result->scan_rst.ble_adv[i];
printf("胎压数据:%x \r\n",ID01[i]);
}
// printf("胎压标定:%x \r\n",ID01[11]);
// //if(Ble_User.Tpms_Updat)
// {
// // ID01[0] = Ble_Tpms_Data.Tpms_Sts;
// // ID01[1] = Ble_Tpms_Data.Tpms_Turn;
// // ID01[2] = Ble_Tpms_Data.Tpms_Dte[0];
// // ID01[3] = Ble_Tpms_Data.Tpms_Dte[1];
// // ID01[4] = Ble_Tpms_Data.Tpms_Dte[2];
// // ID01[5] = Ble_Tpms_Data.Tpms_Dte[3];
// // printf("ID01_Len = %d\r\n",ID01_Len);
// for(i = 0; i < ID01_Len; i++)
// {
// //ID01[i] = scan_result->scan_rst.ble_adv[i];
// printf("胎压数据:%x \r\n",ID01[i]);
// }
// // printf("胎压标定:%x \r\n",ID01[11]);
// ID01[0] = 0xFF;//胎压状态
// ID01[1] = 1;//前轮高字节气压值
// ID01[2] = 200;//前轮低字节气压值
// ID01[3] = 0x28;//前轮胎压温度
// ID01[4] = 1;//后轮高字节气压值
// ID01[5] = 45;//后轮低字节气压值
// ID01[6] = 0xAB;//后轮胎压温度
// // ID01[0] = 0xFF;//胎压状态
// // ID01[1] = 1;//前轮高字节气压值
// // ID01[2] = 200;//前轮低字节气压值
// // ID01[3] = 0x28;//前轮胎压温度
// // ID01[4] = 1;//后轮高字节气压值
// // ID01[5] = 45;//后轮低字节气压值
// // ID01[6] = 0xAB;//后轮胎压温度
//
}
// //
// }
if ((ID01[24] == 0x28)&&(ID01[25] == 0xA8))
{
Protocol_Send(0x01,ID01,ID01_Len);
}
}
......@@ -399,7 +402,7 @@ void Prot_Send_Msg_Process(void )
{
Uart_Send_Id02_Pro();
Prot_User.TimeDelay = 0;
printf("send 0x02 \r\n");
//printf("send 0x02 \r\n");
}
}
Uart_Send_Id01_Pro();
......
......@@ -352,9 +352,9 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
case ESP_GAP_SEARCH_INQ_RES_EVT://用于在设备执行蓝牙扫描时报告发现的结果。在扫描过程中发现一个或多个BLE设备时,会触发这个事件
//esp_log_buffer_hex(GATTC_TAG, scan_result->scan_rst.bda, 6);//尤其是当你需要查看设备地址、UUID ,Mac地址。
if((scan_result->scan_rst.bda[4] == 0x22)||(scan_result->scan_rst.bda[4] == 0x1c))
//if((scan_result->scan_rst.bda[4] == 0x22)||(scan_result->scan_rst.bda[4] == 0x1c))
{
esp_log_buffer_hex("1111111111111111111111111111111111111",scan_result->scan_rst.ble_adv,scan_result->scan_rst.adv_data_len);
//esp_log_buffer_hex("1111111111111111111111111111111111111",scan_result->scan_rst.ble_adv,scan_result->scan_rst.adv_data_len);
//ESP_LOGI(GATTC_TAG, "searched Adv Data Len %d, Scan Response Len %d", scan_result->scan_rst.adv_data_len, scan_result->scan_rst.scan_rsp_len);
//adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv,ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);
//ESP_LOGI(GATTC_TAG, "searched Device Name Len %d", adv_name_len);
......@@ -362,22 +362,22 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
//printf("scan_result->scan_rst.adv_data_len = %d\r\n",scan_result->scan_rst.adv_data_len);
//tpms名字
printf("222222222222222222222222222222222 = %x \r\n",scan_result->scan_rst.ble_adv[2]);
printf("333333333333333333333333333333333 = %x \r\n",scan_result->scan_rst.ble_adv[3]);
printf("444444444444444444444444444444444 = %x \r\n",scan_result->scan_rst.ble_adv[4]);
printf("555555555555555555555555555555555 = %x \r\n",scan_result->scan_rst.ble_adv[5]);
printf("666666666666666666666666666666666 = %x \r\n",scan_result->scan_rst.ble_adv[6]);
printf("777777777777777777777777777777777 = %x \r\n",scan_result->scan_rst.ble_adv[7]);
printf("888888888888888888888888888888888 = %x \r\n",scan_result->scan_rst.ble_adv[8]);
//mac
printf("16 = %x \r\n",scan_result->scan_rst.ble_adv[16]);
printf("17 = %x \r\n",scan_result->scan_rst.ble_adv[17]);
printf("18 = %x \r\n",scan_result->scan_rst.ble_adv[18]);
printf("19 = %x \r\n",scan_result->scan_rst.ble_adv[19]);
printf("20 = %x \r\n",scan_result->scan_rst.ble_adv[20]);
printf("21 = %x \r\n",scan_result->scan_rst.ble_adv[21]);
// //tpms名字
// printf("222222222222222222222222222222222 = %x \r\n",scan_result->scan_rst.ble_adv[2]);
// printf("333333333333333333333333333333333 = %x \r\n",scan_result->scan_rst.ble_adv[3]);
// printf("444444444444444444444444444444444 = %x \r\n",scan_result->scan_rst.ble_adv[4]);
// printf("555555555555555555555555555555555 = %x \r\n",scan_result->scan_rst.ble_adv[5]);
// printf("666666666666666666666666666666666 = %x \r\n",scan_result->scan_rst.ble_adv[6]);
// printf("777777777777777777777777777777777 = %x \r\n",scan_result->scan_rst.ble_adv[7]);
// printf("888888888888888888888888888888888 = %x \r\n",scan_result->scan_rst.ble_adv[8]);
// //mac
// printf("16 = %x \r\n",scan_result->scan_rst.ble_adv[16]);
// printf("17 = %x \r\n",scan_result->scan_rst.ble_adv[17]);
// printf("18 = %x \r\n",scan_result->scan_rst.ble_adv[18]);
// printf("19 = %x \r\n",scan_result->scan_rst.ble_adv[19]);
// printf("20 = %x \r\n",scan_result->scan_rst.ble_adv[20]);
// printf("21 = %x \r\n",scan_result->scan_rst.ble_adv[21]);
if((scan_result->scan_rst.ble_adv[2] == 0x54)&&
(scan_result->scan_rst.ble_adv[3] == 0x43)&&
......@@ -392,9 +392,10 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
for(i = 0; i < scan_result->scan_rst.adv_data_len; i++)
{
ID01[i] = scan_result->scan_rst.ble_adv[i];
//printf("数据:%x \r\n",ID01[i]);
}
}
//printf("地址:%x \r\n",scan_result->scan_rst.bda[4]);
}
#if CONFIG_EXAMPLE_DUMP_ADV_DATA_AND_SCAN_RESP
......
......@@ -701,8 +701,6 @@ CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20
CONFIG_BTDM_RESERVE_DRAM=0xdb5c
CONFIG_BTDM_CTRL_HLI=y
# end of Controller Options
# CONFIG_BT_HCI_LOG_DEBUG_EN is not set
# end of Bluetooth
# CONFIG_BLE_MESH is not set
......
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