mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
bluedroid: support get bluetooth device name
This commit is contained in:
parent
4571dd1d2f
commit
31f6dab386
@ -383,6 +383,19 @@ esp_err_t esp_ble_gap_set_device_name(const char *name)
|
|||||||
return esp_bt_dev_set_device_name(name);
|
return esp_bt_dev_set_device_name(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_gap_get_device_name(void)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_GAP_BLE;
|
||||||
|
msg.act = BTC_GAP_BLE_ACT_GET_DEV_NAME;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t * addr_type)
|
esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t * addr_type)
|
||||||
{
|
{
|
||||||
if(esp_bluedroid_get_status() != (ESP_BLUEDROID_STATUS_ENABLED)) {
|
if(esp_bluedroid_get_status() != (ESP_BLUEDROID_STATUS_ENABLED)) {
|
||||||
|
@ -137,7 +137,7 @@ typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capab
|
|||||||
|
|
||||||
/// GAP BLE callback event type
|
/// GAP BLE callback event type
|
||||||
typedef enum {
|
typedef enum {
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_42_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */
|
ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT = 0, /*!< When advertising data set complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< When scan response data set complete, the event comes */
|
ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< When scan response data set complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
|
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
|
||||||
@ -146,7 +146,7 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
|
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
|
||||||
ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */
|
ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */
|
ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */
|
||||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */
|
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */
|
||||||
ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */
|
ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */
|
||||||
ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */
|
ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */
|
||||||
@ -156,10 +156,10 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */
|
ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */
|
||||||
ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */
|
ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */
|
||||||
ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */
|
ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_42_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
|
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
|
||||||
ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */
|
ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */
|
||||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT = 19, /*!< When set the static rand address complete, the event comes */
|
ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT = 19, /*!< When set the static rand address complete, the event comes */
|
||||||
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT, /*!< When update connection parameters complete, the event comes */
|
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT, /*!< When update connection parameters complete, the event comes */
|
||||||
ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT, /*!< When set pkt length complete, the event comes */
|
ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT, /*!< When set pkt length complete, the event comes */
|
||||||
@ -169,11 +169,11 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */
|
ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT, /*!< When get the bond device list complete, the event comes */
|
||||||
ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */
|
ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT, /*!< When read the rssi complete, the event comes */
|
||||||
ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
|
ESP_GAP_BLE_UPDATE_WHITELIST_COMPLETE_EVT, /*!< When add or remove whitelist complete, the event comes */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_42_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT, /*!< When update duplicate exceptional list complete, the event comes */
|
ESP_GAP_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_COMPLETE_EVT, /*!< When update duplicate exceptional list complete, the event comes */
|
||||||
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */
|
ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */
|
||||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
//BLE_50_FEATURE_SUPPORT
|
||||||
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT,
|
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT,
|
||||||
ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT,
|
ESP_GAP_BLE_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT,
|
||||||
ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT,
|
ESP_GAP_BLE_SET_PREFERED_PHY_COMPLETE_EVT,
|
||||||
@ -208,7 +208,8 @@ typedef enum {
|
|||||||
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT,
|
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT,
|
||||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT,
|
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT,
|
||||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT,
|
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT,
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
//BLE_INCLUDED
|
||||||
|
ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT, /*!< When getting BT device name complete, the event comes */
|
||||||
ESP_GAP_BLE_EVT_MAX,
|
ESP_GAP_BLE_EVT_MAX,
|
||||||
} esp_gap_ble_cb_event_t;
|
} esp_gap_ble_cb_event_t;
|
||||||
|
|
||||||
@ -907,6 +908,13 @@ typedef struct {
|
|||||||
* @brief Gap callback parameters union
|
* @brief Gap callback parameters union
|
||||||
*/
|
*/
|
||||||
typedef union {
|
typedef union {
|
||||||
|
/**
|
||||||
|
* @brief ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT
|
||||||
|
*/
|
||||||
|
struct ble_get_dev_name_cmpl_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate the get device name success status */
|
||||||
|
char *name; /*!< Name of bluetooth device */
|
||||||
|
} get_dev_name_cmpl; /*!< Event parameter of ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT */
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
/**
|
/**
|
||||||
* @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
|
* @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
|
||||||
@ -1534,7 +1542,17 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
|
|||||||
esp_err_t esp_ble_gap_set_device_name(const char *name);
|
esp_err_t esp_ble_gap_set_device_name(const char *name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function is called to get local used address and adress type.
|
* @brief Get device name of the local device
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_gap_get_device_name(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to get local used address and address type.
|
||||||
* uint8_t *esp_bt_dev_get_address(void) get the public address
|
* uint8_t *esp_bt_dev_get_address(void) get the public address
|
||||||
*
|
*
|
||||||
* @param[in] local_used_addr - current local used ble address (six bytes)
|
* @param[in] local_used_addr - current local used ble address (six bytes)
|
||||||
|
@ -673,6 +673,27 @@ void bta_dm_set_dev_name (tBTA_DM_MSG *p_data)
|
|||||||
#endif /// CLASSIC_BT_INCLUDED
|
#endif /// CLASSIC_BT_INCLUDED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function bta_dm_get_dev_name
|
||||||
|
**
|
||||||
|
** Description Gets local device name
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns void
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void bta_dm_get_dev_name (tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
tBTM_STATUS status;
|
||||||
|
char *name = NULL;
|
||||||
|
|
||||||
|
status = BTM_ReadLocalDeviceName(&name);
|
||||||
|
if (p_data->get_name.p_cback) {
|
||||||
|
(*p_data->get_name.p_cback)(status, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_dm_set_afh_channels
|
** Function bta_dm_set_afh_channels
|
||||||
|
@ -181,6 +181,27 @@ void BTA_DmSetDeviceName(const char *p_name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function BTA_DmGetDeviceName
|
||||||
|
**
|
||||||
|
** Description This function gets the Bluetooth name of local device
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns void
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_GET_NAME *p_msg;
|
||||||
|
|
||||||
|
if ((p_msg = (tBTA_DM_API_GET_NAME *) osi_malloc(sizeof(tBTA_DM_API_GET_NAME))) != NULL) {
|
||||||
|
p_msg->hdr.event = BTA_DM_API_GET_NAME_EVT;
|
||||||
|
p_msg->p_cback = p_cback;
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
|
|
||||||
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
||||||
|
@ -57,6 +57,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
|||||||
bta_dm_enable, /* BTA_DM_API_ENABLE_EVT */
|
bta_dm_enable, /* BTA_DM_API_ENABLE_EVT */
|
||||||
bta_dm_disable, /* BTA_DM_API_DISABLE_EVT */
|
bta_dm_disable, /* BTA_DM_API_DISABLE_EVT */
|
||||||
bta_dm_set_dev_name, /* BTA_DM_API_SET_NAME_EVT */
|
bta_dm_set_dev_name, /* BTA_DM_API_SET_NAME_EVT */
|
||||||
|
bta_dm_get_dev_name, /* BTA_DM_API_GET_NAME_EVT */
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
||||||
#endif
|
#endif
|
||||||
|
@ -52,6 +52,7 @@ enum {
|
|||||||
BTA_DM_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_DM),
|
BTA_DM_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_DM),
|
||||||
BTA_DM_API_DISABLE_EVT,
|
BTA_DM_API_DISABLE_EVT,
|
||||||
BTA_DM_API_SET_NAME_EVT,
|
BTA_DM_API_SET_NAME_EVT,
|
||||||
|
BTA_DM_API_GET_NAME_EVT,
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
BTA_DM_API_CONFIG_EIR_EVT,
|
BTA_DM_API_CONFIG_EIR_EVT,
|
||||||
#endif
|
#endif
|
||||||
@ -227,6 +228,11 @@ typedef struct {
|
|||||||
BD_NAME name; /* max 248 bytes name, plus must be Null terminated */
|
BD_NAME name; /* max 248 bytes name, plus must be Null terminated */
|
||||||
} tBTA_DM_API_SET_NAME;
|
} tBTA_DM_API_SET_NAME;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_GET_DEV_NAME_CBACK *p_cback;
|
||||||
|
} tBTA_DM_API_GET_NAME;
|
||||||
|
|
||||||
/* data type for BTA_DM_API_CONFIG_EIR_EVT */
|
/* data type for BTA_DM_API_CONFIG_EIR_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BT_HDR hdr;
|
BT_HDR hdr;
|
||||||
@ -1013,6 +1019,7 @@ typedef union {
|
|||||||
tBTA_DM_API_ENABLE enable;
|
tBTA_DM_API_ENABLE enable;
|
||||||
|
|
||||||
tBTA_DM_API_SET_NAME set_name;
|
tBTA_DM_API_SET_NAME set_name;
|
||||||
|
tBTA_DM_API_GET_NAME get_name;
|
||||||
tBTA_DM_API_CONFIG_EIR config_eir;
|
tBTA_DM_API_CONFIG_EIR config_eir;
|
||||||
|
|
||||||
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
|
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
|
||||||
@ -1506,6 +1513,7 @@ extern void bta_dm_search_sm_disable( void );
|
|||||||
extern void bta_dm_enable (tBTA_DM_MSG *p_data);
|
extern void bta_dm_enable (tBTA_DM_MSG *p_data);
|
||||||
extern void bta_dm_disable (tBTA_DM_MSG *p_data);
|
extern void bta_dm_disable (tBTA_DM_MSG *p_data);
|
||||||
extern void bta_dm_set_dev_name (tBTA_DM_MSG *p_data);
|
extern void bta_dm_set_dev_name (tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_get_dev_name (tBTA_DM_MSG *p_data);
|
||||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||||
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
|
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
|
||||||
#endif
|
#endif
|
||||||
|
@ -176,6 +176,8 @@ typedef struct {
|
|||||||
|
|
||||||
typedef UINT16 tBTA_SEC;
|
typedef UINT16 tBTA_SEC;
|
||||||
|
|
||||||
|
typedef tBTM_GET_DEV_NAME_CBACK tBTA_GET_DEV_NAME_CBACK;
|
||||||
|
|
||||||
/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
|
/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
|
||||||
#define BTA_DM_IGNORE 0x00FF
|
#define BTA_DM_IGNORE 0x00FF
|
||||||
|
|
||||||
@ -1669,6 +1671,18 @@ extern void BTA_DisableTestMode(void);
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
extern void BTA_DmSetDeviceName(const char *p_name);
|
extern void BTA_DmSetDeviceName(const char *p_name);
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function BTA_DmGetDeviceName
|
||||||
|
**
|
||||||
|
** Description This function gets the Bluetooth name of the local device.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** Returns void
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
extern void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function BTA_DmGetRemoteName
|
** Function BTA_DmGetRemoteName
|
||||||
|
@ -70,6 +70,33 @@ static inline void btc_gap_ble_cb_to_app(esp_gap_ble_cb_event_t event, esp_ble_g
|
|||||||
btc_gap_ble_cb(event, param);
|
btc_gap_ble_cb(event, param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void btc_gap_ble_get_dev_name_callback(UINT8 status, char *name)
|
||||||
|
{
|
||||||
|
esp_ble_gap_cb_param_t param;
|
||||||
|
bt_status_t ret;
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
|
||||||
|
memset(¶m, 0, sizeof(esp_ble_gap_cb_param_t));
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CB;
|
||||||
|
msg.pid = BTC_PID_GAP_BLE;
|
||||||
|
msg.act = ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT;
|
||||||
|
|
||||||
|
param.get_dev_name_cmpl.status = btc_btm_status_to_esp_status(status);
|
||||||
|
param.get_dev_name_cmpl.name = (char *)osi_malloc(BTC_MAX_LOC_BD_NAME_LEN + 1);
|
||||||
|
if (param.get_dev_name_cmpl.name) {
|
||||||
|
BCM_STRNCPY_S(param.get_dev_name_cmpl.name, name, BTC_MAX_LOC_BD_NAME_LEN + 1);
|
||||||
|
} else {
|
||||||
|
param.get_dev_name_cmpl.status = ESP_BT_STATUS_NOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = btc_transfer_context(&msg, ¶m, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||||
|
if (ret != BT_STATUS_SUCCESS) {
|
||||||
|
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
static void btc_gap_adv_point_cleanup(void **buf)
|
static void btc_gap_adv_point_cleanup(void **buf)
|
||||||
{
|
{
|
||||||
@ -1473,6 +1500,13 @@ void btc_gap_ble_cb_deep_free(btc_msg_t *msg)
|
|||||||
{
|
{
|
||||||
BTC_TRACE_DEBUG("%s", __func__);
|
BTC_TRACE_DEBUG("%s", __func__);
|
||||||
switch (msg->act) {
|
switch (msg->act) {
|
||||||
|
case ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT: {
|
||||||
|
char *value = ((esp_ble_gap_cb_param_t *)msg->arg)->get_dev_name_cmpl.name;
|
||||||
|
if (value) {
|
||||||
|
osi_free(value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
||||||
break;
|
break;
|
||||||
@ -1559,6 +1593,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
|||||||
case BTC_GAP_BLE_ACT_SET_DEV_NAME:
|
case BTC_GAP_BLE_ACT_SET_DEV_NAME:
|
||||||
BTA_DmSetDeviceName(arg->set_dev_name.device_name);
|
BTA_DmSetDeviceName(arg->set_dev_name.device_name);
|
||||||
break;
|
break;
|
||||||
|
case BTC_GAP_BLE_ACT_GET_DEV_NAME:
|
||||||
|
BTA_DmGetDeviceName(btc_gap_ble_get_dev_name_callback);
|
||||||
|
break;
|
||||||
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
case BTC_GAP_BLE_ACT_CFG_ADV_DATA_RAW:
|
case BTC_GAP_BLE_ACT_CFG_ADV_DATA_RAW:
|
||||||
btc_ble_set_adv_data_raw(arg->cfg_adv_data_raw.raw_adv,
|
btc_ble_set_adv_data_raw(arg->cfg_adv_data_raw.raw_adv,
|
||||||
|
@ -91,6 +91,7 @@ typedef enum {
|
|||||||
BTC_GAP_BLE_STOP_EXT_SCAN,
|
BTC_GAP_BLE_STOP_EXT_SCAN,
|
||||||
BTC_GAP_BLE_SET_EXT_PEFER_CONNET_PARAMS,
|
BTC_GAP_BLE_SET_EXT_PEFER_CONNET_PARAMS,
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
BTC_GAP_BLE_ACT_GET_DEV_NAME,
|
||||||
} btc_gap_ble_act_t;
|
} btc_gap_ble_act_t;
|
||||||
|
|
||||||
/* btc_ble_gap_args_t */
|
/* btc_ble_gap_args_t */
|
||||||
|
@ -157,6 +157,7 @@ typedef enum{
|
|||||||
|
|
||||||
typedef void (tBTM_DEV_STATUS_CB) (tBTM_DEV_STATUS status);
|
typedef void (tBTM_DEV_STATUS_CB) (tBTM_DEV_STATUS status);
|
||||||
|
|
||||||
|
typedef void (tBTM_GET_DEV_NAME_CBACK) (UINT8 status, char *name);
|
||||||
|
|
||||||
/* Callback function for when a vendor specific event occurs. The length and
|
/* Callback function for when a vendor specific event occurs. The length and
|
||||||
** array of returned parameter bytes are included. This asynchronous event
|
** array of returned parameter bytes are included. This asynchronous event
|
||||||
|
Loading…
x
Reference in New Issue
Block a user