OSDN Git Service

LE low power scan feature
authorSatya Calloji <satyac@broadcom.com>
Tue, 31 Mar 2015 20:58:21 +0000 (13:58 -0700)
committerSatya Calloji <satyac@broadcom.com>
Fri, 17 Apr 2015 21:27:17 +0000 (14:27 -0700)
LE low power extended scan feature header changes
based on Google spec v0.95

Bug: 20029342
Change-Id: Id1020a4da177d0bc421fdd123c5355a291cc0475

include/hardware/bluetooth.h
include/hardware/bt_gatt_client.h

index 1be4009..893f85d 100644 (file)
@@ -152,6 +152,8 @@ typedef struct
     uint8_t activity_energy_info_supported;
     uint16_t scan_result_storage_size;
     uint16_t total_trackable_advertisers;
+    bool extended_scan_support;
+    bool debug_logging_supported;
 }bt_local_le_features_t;
 
 /* Bluetooth Adapter and Remote Device property types */
index 7881dc8..e7e8e82 100644 (file)
@@ -96,6 +96,25 @@ typedef struct
     uint16_t            u5;
 } btgatt_test_params_t;
 
+/* BT GATT client error codes */
+typedef enum
+{
+    BT_GATTC_COMMAND_SUCCESS = 0,    /* 0  Command succeeded                 */
+    BT_GATTC_COMMAND_STARTED,        /* 1  Command started OK.               */
+    BT_GATTC_COMMAND_BUSY,           /* 2  Device busy with another command  */
+    BT_GATTC_COMMAND_STORED,         /* 3 request is stored in control block */
+    BT_GATTC_NO_RESOURCES,           /* 4  No resources to issue command     */
+    BT_GATTC_MODE_UNSUPPORTED,       /* 5  Request for 1 or more unsupported modes */
+    BT_GATTC_ILLEGAL_VALUE,          /* 6  Illegal command /parameter value  */
+    BT_GATTC_INCORRECT_STATE,        /* 7  Device in wrong state for request  */
+    BT_GATTC_UNKNOWN_ADDR,           /* 8  Unknown remote BD address         */
+    BT_GATTC_DEVICE_TIMEOUT,         /* 9  Device timeout                    */
+    BT_GATTC_INVALID_CONTROLLER_OUTPUT,/* 10  An incorrect value was received from HCI */
+    BT_GATTC_SECURITY_ERROR,          /* 11 Authorization or security failure or not authorized  */
+    BT_GATTC_DELAYED_ENCRYPTION_CHECK, /*12 Delayed encryption check */
+    BT_GATTC_ERR_PROCESSING           /* 12 Generic error                     */
+} btgattc_error_t;
+
 /** BT-GATT Client callback structure. */
 
 /** Callback invoked in response to register_client */
@@ -222,6 +241,10 @@ typedef void (*batchscan_threshold_callback)(int client_if);
 /** Track ADV VSE callback invoked when tracked device is found or lost */
 typedef void (*track_adv_event_callback)(btgatt_track_adv_info_t *p_track_adv_info);
 
+/** Callback invoked when scan parameter setup has completed */
+typedef void (*scan_parameter_setup_completed_callback)(int client_if,
+                                                        btgattc_error_t status);
+
 typedef struct {
     register_client_callback            register_client_cb;
     scan_result_callback                scan_result_cb;
@@ -255,6 +278,7 @@ typedef struct {
     batchscan_reports_callback          batchscan_reports_cb;
     batchscan_threshold_callback        batchscan_threshold_cb;
     track_adv_event_callback            track_adv_event_cb;
+    scan_parameter_setup_completed_callback scan_parameter_setup_completed_cb;
 } btgatt_client_callbacks_t;
 
 /** Represents the standard BT-GATT client interface. */
@@ -388,7 +412,7 @@ typedef struct {
                     int max_interval, int latency, int timeout);
 
     /** Sets the LE scan interval and window in units of N*0.625 msec */
-    bt_status_t (*set_scan_parameters)(int scan_interval, int scan_window);
+    bt_status_t (*set_scan_parameters)(int client_if, int scan_interval, int scan_window);
 
     /* Setup the parameters as per spec, user manual specified values and enable multi ADV */
     bt_status_t (*multi_adv_enable)(int client_if, int min_interval,int max_interval,int adv_type,