diff --git a/examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c b/examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c index 7e7f73db1..09b7206ef 100644 --- a/examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c +++ b/examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c @@ -78,6 +78,7 @@ static void bt_app_task_handler(void *arg) #endif ///BUT_PROFILE_CFG } + osi_free(e); } } diff --git a/examples/07_blufi/components/bluedroid_demos/app_core/bt_app_core.c b/examples/07_blufi/components/bluedroid_demos/app_core/bt_app_core.c index 3510b657c..1ef8e63a9 100644 --- a/examples/07_blufi/components/bluedroid_demos/app_core/bt_app_core.c +++ b/examples/07_blufi/components/bluedroid_demos/app_core/bt_app_core.c @@ -15,12 +15,14 @@ #include "bt_app_common.h" #include "controller.h" - +#include "prf_defs.h" #include "hash_map.h" #include "hash_functions.h" #include "alarm.h" -#include "app_button.h" +//#include "app_button.h" +#if (BUT_PROFILE_CFG) #include "button_pro.h" +#endif ///BUT_PROFILE_CFG #include "thread.h" #include "bt_app_common.h" #include "dis_api.h" @@ -64,11 +66,17 @@ static void bt_app_task_handler(void *arg) if (e->sig == 0xff) { fixed_queue_process(bta_app_msg_queue); fixed_queue_process(bt_app_general_alarm_queue); - }else if(e->sig == BUTTON_PRESS_EVT){ + } +#if (BUT_PROFILE_CFG) + else if(e->sig == BUTTON_PRESS_EVT){ LOG_ERROR("button_press_event come in,button_value=%x\n",e->par); button_msg[1] = e->par; - button_msg_notify(2,button_msg); -} + button_msg_notify(2,button_msg); + + + } +#endif ///BUT_PROFILE_CFG + } osi_free(e); } @@ -200,7 +208,7 @@ void bt_app_task_start_up(void) return; error_exit: - LOG_ERROR("%s Unable to allocate resources for bt_app", __func__); + LOG_ERROR("%s Unable to allocate resources for bt_app\n", __func__); bt_app_task_shut_down(); } @@ -271,6 +279,12 @@ static void bt_app_dm_upstreams_evt(UINT16 event, char *p_param) smp_set_state(SMP_STATE_WAIT_CONFIRM); //BTA_DmConfirm(p_data->ble_req.bd_addr,true); break; + case BTA_DM_BLE_KEY_EVT: + if(p_data->ble_key.key_type == BTM_LE_KEY_PENC) + { + smp_set_state(SMP_STATE_IDLE); + } + break; default: break; } @@ -319,7 +333,7 @@ void bt_app_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec) alarm = hash_map_get(bt_app_general_alarm_hash_map, p_tle); pthread_mutex_unlock(&bt_app_general_alarm_lock); if (alarm == NULL) { - LOG_ERROR("%s Unable to create alarm", __func__); + LOG_ERROR("%s Unable to create alarm\n", __func__); return; } diff --git a/examples/07_blufi/components/bluedroid_demos/app_project/SampleServerProject.c b/examples/07_blufi/components/bluedroid_demos/app_project/SampleServerProject.c index 4028935d0..a9e4cf11a 100644 --- a/examples/07_blufi/components/bluedroid_demos/app_project/SampleServerProject.c +++ b/examples/07_blufi/components/bluedroid_demos/app_project/SampleServerProject.c @@ -12,6 +12,8 @@ #include #include +#include "prf_defs.h" + #include "bta_api.h" #include "bta_gatt_api.h" #include "controller.h" @@ -26,7 +28,7 @@ //#include "app_button.h" #include "button_pro.h" #include "hid_le_prf.h" -#include "prf_defs.h" + #include "hcimsgs.h" #include "bt_app_defs.h" @@ -104,8 +106,9 @@ tESP_BLE_ADV_DATA ijiazu_adv_data[ADV_SCAN_IDX_MAX] = } }; +#if (BUT_PROFILE_CFG) static void SimpleDataCallBack(UINT8 app_id, UINT8 event, UINT8 len, UINT8 *p_data); - +#endif typedef struct { uint8_t uu[16]; @@ -182,8 +185,11 @@ static void bta_gatts_set_adv_data_cback(tBTA_STATUS call_status) //bas_register(); /*instantiate the driver for button profile*/ //app_button_init(); +#if (BUT_PROFILE_CFG) /*instantiate a button service*/ button_init(SimpleDataCallBack); +#endif ///BUT_PROFILE_CFG + /*instantiate a hid device service*/ //hidd_le_init(); /*start advetising*/ @@ -229,6 +235,7 @@ void bta_gatts_callback(tBTA_GATTS_EVT event, tBTA_GATTS* p_data) } +#if (BUT_PROFILE_CFG) #define HEADER_SSID "ssid" #define HEADER_PASSWD "passwd" #define HEADER_CONFIRM "confirm" @@ -270,6 +277,7 @@ static void SimpleDataCallBack(UINT8 app_id, UINT8 event, UINT8 len, UINT8 *p_da } } +#endif ///BUT_PROFILE_CFG static void ble_server_appRegister(void) {