bluedroid: support get bluetooth device name
This commit is contained in:
@@ -127,7 +127,7 @@ typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capab
|
||||
|
||||
/// GAP BLE callback event type
|
||||
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_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 */
|
||||
@@ -136,7 +136,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_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 */
|
||||
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||
//BLE_INCLUDED
|
||||
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_SEC_REQ_EVT, /*!< BLE security request */
|
||||
@@ -146,10 +146,10 @@ typedef enum {
|
||||
ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */
|
||||
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) 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_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_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 */
|
||||
@@ -159,13 +159,11 @@ typedef enum {
|
||||
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_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 */
|
||||
#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_SC_OOB_REQ_EVT, /*!< Secure Connection OOB request event */
|
||||
ESP_GAP_BLE_SC_CR_LOC_OOB_EVT, /*!< Secure Connection create OOB data complete event */
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
//BLE_50_FEATURE_SUPPORT
|
||||
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */
|
||||
ESP_GAP_BLE_SET_PREFERRED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */
|
||||
ESP_GAP_BLE_SET_PREFERRED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */
|
||||
@@ -200,7 +198,10 @@ typedef enum {
|
||||
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */
|
||||
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
//BLE_INCLUDED
|
||||
ESP_GAP_BLE_SC_OOB_REQ_EVT, /*!< Secure Connection OOB request event */
|
||||
ESP_GAP_BLE_SC_CR_LOC_OOB_EVT, /*!< Secure Connection create OOB data complete event */
|
||||
ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT, /*!< When getting BT device name complete, the event comes */
|
||||
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||
} esp_gap_ble_cb_event_t;
|
||||
|
||||
@@ -912,6 +913,13 @@ typedef struct {
|
||||
* @brief Gap callback parameters 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)
|
||||
/**
|
||||
* @brief ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT
|
||||
@@ -1538,6 +1546,16 @@ 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);
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
||||
Reference in New Issue
Block a user