Commit ab80e4bc authored by 时昊's avatar 时昊

feat:增加打电话显示电话号码功能

parent 8b38084d
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "freertos/task.h" #include "freertos/task.h"
#include "esp_log.h" #include "esp_log.h"
#include "bt_app_core.h" #include "bt_app_core.h"
#include "esp_hf_client_api.h"
static void bt_app_task_handler(void *arg); static void bt_app_task_handler(void *arg);
static bool bt_app_send_msg(bt_app_msg_t *msg); static bool bt_app_send_msg(bt_app_msg_t *msg);
......
...@@ -423,12 +423,6 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -423,12 +423,6 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
number_length = 20; number_length = 20;
} }
memcpy(Iphone_Num, param->clip.number, number_length); memcpy(Iphone_Num, param->clip.number, number_length);
// for (int i = 0; i < sizeof(Iphone_Num); i++)
// {
// // 0xcf 为无效值不显示
// }
//ESP_LOGI(BT_HF_TAG, "--ipnumber_length %x", number_length);
} }
break; break;
...@@ -443,12 +437,29 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_ ...@@ -443,12 +437,29 @@ void bt_app_hf_client_cb(esp_hf_client_cb_event_t event, esp_hf_client_cb_param_
case ESP_HF_CLIENT_CLCC_EVT: case ESP_HF_CLIENT_CLCC_EVT:
{ {
memset(Iphone_Num, 0xff, sizeof(Iphone_Num));
ESP_LOGI(BT_HF_TAG, "--Current call: idx %d, dir %s, state %s, mpty %s, number %s", ESP_LOGI(BT_HF_TAG, "--Current call: idx %d, dir %s, state %s, mpty %s, number %s",
param->clcc.idx, param->clcc.idx,
c_call_dir_str[param->clcc.dir], c_call_dir_str[param->clcc.dir],
c_call_state_str[param->clcc.status], c_call_state_str[param->clcc.status],
c_call_mpty_type_str[param->clcc.mpty], c_call_mpty_type_str[param->clcc.mpty],
(param->clcc.number == NULL) ? "NULL" : (param->clcc.number)); (param->clcc.number == NULL) ? "NULL" : (param->clcc.number));
if (param->clcc.number == NULL)
{
;
}
else
{
number_length = strlen(param->clcc.number);
if (number_length > 20)
{
number_length = 20;
}
memcpy(Iphone_Num, param->clcc.number, number_length);
}
break; break;
} }
......
...@@ -93,6 +93,7 @@ static void Sys_Run_Tasks(void *arg) ...@@ -93,6 +93,7 @@ static void Sys_Run_Tasks(void *arg)
if(SYS_RUN_TASK_1000MS) if(SYS_RUN_TASK_1000MS)
{ {
esp_hf_client_query_current_calls();
// simple_ota_service(); // simple_ota_service();
...@@ -101,8 +102,8 @@ static void Sys_Run_Tasks(void *arg) ...@@ -101,8 +102,8 @@ static void Sys_Run_Tasks(void *arg)
{ {
testcnt = 0; testcnt = 0;
printf("BT_User.BT_Sts = %d\r\n", BT_User.BT_Sts); //printf("BT_User.BT_Sts = %d\r\n", BT_User.BT_Sts);
printf("Ble_User.Ble_Sts = %d\r\n", Ble_User.Ble_Sts); //printf("Ble_User.Ble_Sts = %d\r\n", Ble_User.Ble_Sts);
// esp_log_buffer_hex(TAG, peer_addr, 6); // esp_log_buffer_hex(TAG, peer_addr, 6);
......
...@@ -1336,15 +1336,16 @@ CONFIG_HEAP_TRACING_OFF=y ...@@ -1336,15 +1336,16 @@ CONFIG_HEAP_TRACING_OFF=y
# #
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set CONFIG_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=y # CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_DEFAULT_LEVEL=2
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=3 CONFIG_LOG_MAXIMUM_LEVEL=2
CONFIG_LOG_COLORS=y CONFIG_LOG_COLORS=y
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM 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