#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"
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);
}
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();
}
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;
}
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;
}
#include <stdbool.h>
#include <stdio.h>
+#include "prf_defs.h"
+
#include "bta_api.h"
#include "bta_gatt_api.h"
#include "controller.h"
//#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"
}
};
+#if (BUT_PROFILE_CFG)
static void SimpleDataCallBack(UINT8 app_id, UINT8 event, UINT8 len, UINT8 *p_data);
-
+#endif
typedef struct {
uint8_t uu[16];
//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*/
}
+#if (BUT_PROFILE_CFG)
#define HEADER_SSID "ssid"
#define HEADER_PASSWD "passwd"
#define HEADER_CONFIRM "confirm"
}
}
+#endif ///BUT_PROFILE_CFG
static void ble_server_appRegister(void)
{