component bt:Added the app_button event process function to the bt project

This commit is contained in:
Yulong
2016-11-02 02:21:31 -04:00
parent 97c75a88ae
commit 2cea783ca1
3 changed files with 68 additions and 13 deletions

View File

@@ -41,6 +41,13 @@
#include "button_pro.h"
#include "app_button_int.h"
static const tBTA_SYS_REG bta_gatts_reg =
{
ble_but_prf_hdl_event,
ble_but_prf_disable
};
/*******************************************************************************
**
@@ -82,6 +89,40 @@ BOOLEAN ble_but_prf_hdl_event(BT_HDR *msg_data)
}
/*******************************************************************************
**
** Function ble_but_prf_disable
**
** Description This function is called to disable the button profile modlue
**
** Parameters None.
**
** Returns None
**
*******************************************************************************/
void ble_but_prf_disable(void)
{
BT_HDR *p_buf;
if (bt_prf_sys_is_register(PRF_ID_BUT_LE) == FALSE)
{
APPL_TRACE_WARNING("button profile Module not enabled/already disabled");
return;
}
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_GATTS_API_DISABLE_EVT;
bta_sys_sendmsg(p_buf);
}
bta_sys_deregister(PRF_ID_BUT_LE);
}
#endif ///BUT_PROFILE_CFG

View File

@@ -105,10 +105,24 @@ typedef struct
uint16_t conhdl;
}tBUT_DISABLE_IND;
typedef union
{
uint16_t conhdl;
tBUT_CRT_DB_REQ but_crt_db_req;
tBUT_CRT_DB_CFM but_crt_db_cfm;
tBUT_CFG_NTF_IND but_cfg_ntf_ind;
tBUT_SND_CHAR_VAL_REQ but_snd_char_val_req;
tBUT_ENABLE_REQ but_enable_req;
tBUT_VAL_SND_CFM but_val_snd_cfm;
tBUT_DISABLE_IND but_disable_ind;
}tBUT_PRF_MSG;
BOOLEAN ble_but_prf_hdl_event(BT_HDR *msg_data);
void ble_but_prf_disable(void);
#endif ///BUT_PROFILE_CFG