]> granicus.if.org Git - esp-idf/commitdiff
component/bt: fix of compiler errors after previous merge of code;
authorwangmengyang <wangmengyang@espressif.com>
Mon, 17 Oct 2016 15:53:02 +0000 (23:53 +0800)
committerwangmengyang <wangmengyang@espressif.com>
Mon, 17 Oct 2016 15:53:02 +0000 (23:53 +0800)
examples/06_bluedroid_demos/components/bluedroid_demos/app_core/bt_app_core.c
examples/07_blufi/components/bluedroid_demos/app_core/bt_app_core.c
examples/07_blufi/components/bluedroid_demos/app_project/SampleServerProject.c

index 7e7f73db14fd62bdcbd864d664a0aec0daea0401..09b7206ef501aa1ee860946616ac3a43f90e4a77 100644 (file)
@@ -78,6 +78,7 @@ static void bt_app_task_handler(void *arg)
 #endif ///BUT_PROFILE_CFG
 
         }
+        osi_free(e);
     }
 }
 
index 3510b657c175b70aecbe03da3a209a5098716a89..1ef8e63a92304d2874f9576effe7c258acb075ff 100644 (file)
 #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;
     }
index 4028935d0764253023207f4a88202dcc937aeef4..a9e4cf11adcbdd0f0a49f5fe0aaa9b65e046917e 100644 (file)
@@ -12,6 +12,8 @@
 #include <stdbool.h>
 #include <stdio.h>
 
+#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)
 {