]> granicus.if.org Git - esp-idf/commitdiff
component/bt : add ble event type
authorTian Hao <tianhao@espressif.com>
Thu, 1 Dec 2016 12:16:09 +0000 (20:16 +0800)
committerTian Hao <tianhao@espressif.com>
Thu, 1 Dec 2016 12:16:09 +0000 (20:16 +0800)
components/bt/bluedroid/api/include/esp_gap_ble_api.h
components/bt/bluedroid/btc/profile/std/gap/btc_gap_ble.c

index 7a320143dbaaadb18b043fea48fdd5f14811235a..242d74f0fe9c58d4d2e725488afafa16dc2c8472 100644 (file)
@@ -203,6 +203,18 @@ typedef enum {
     ESP_GAP_SEARCH_SEARCH_CANCEL_CMPL_EVT  = 6,      /*!< Search cancelled */
 } esp_gap_search_evt_t;
 
+/**
+ * @brief Ble scan result event type, to indicate the
+ *        result is scan response or advertising data or other
+ */
+typedef enum {
+       ESP_BLE_EVT_CONN_ADV         = 0x00,            /*!< Connectable undirected advertising (ADV_IND) */
+       ESP_BLE_EVT_CONN_DIR_ADV     = 0x01,            /*!< Connectable directed advertising (ADV_DIRECT_IND) */
+       ESP_BLE_EVT_DISC_ADV         = 0x02,            /*!< Scannable undirected advertising (ADV_SCAN_IND) */
+       ESP_BLE_EVT_NON_CONN_ADV     = 0x03,            /*!< Non connectable undirected advertising (ADV_NONCONN_IND) */
+       ESP_BLE_EVT_SCAN_RSP         = 0x04,            /*!< Scan Response (SCAN_RSP) */
+} esp_ble_evt_type_t;
+
 /**
  * @brief Gap callback parameters union
  */
@@ -233,6 +245,7 @@ typedef union {
         esp_bd_addr_t bda;                                                     /*!< Bluetooth device address which has been searched */
         esp_bt_dev_type_t dev_type;                                    /*!< Device type */
         esp_ble_addr_type_t ble_addr_type;                     /*!< Ble device address type */
+               esp_ble_evt_type_t ble_evt_type;                        /*!< Ble scan result event type */
         int rssi;                                                                      /*!< Searched device's RSSI */
         uint8_t  ble_adv[ESP_BLE_ADV_DATA_LEN_MAX]; /*!< Received EIR */
         int flag;                                                                      /*!< Advertising data flag bit */
index a37b4054da6deb2e9980f84f608dea08b8f68794..ba9e9622384f885a024636ec0a1b96d97a1ff4b7 100644 (file)
@@ -453,6 +453,7 @@ static void btc_search_callback(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data
         param.scan_rst.dev_type = p_data->inq_res.device_type;
         param.scan_rst.rssi = p_data->inq_res.rssi;
         param.scan_rst.ble_addr_type = p_data->inq_res.ble_addr_type;
+               param.scan_rst.ble_evt_type = p_data->inq_res.ble_evt_type;
         param.scan_rst.flag = p_data->inq_res.flag;
         memcpy(param.scan_rst.ble_adv, p_data->inq_res.p_eir,
                ESP_BLE_ADV_DATA_LEN_MAX);