summaryrefslogtreecommitdiffstats
path: root/device/src/controller.c
diff options
context:
space:
mode:
authorSrinu Jella <sjella@codeaurora.org>2015-07-22 17:30:32 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:21:36 -0600
commita1bff6f9b63b5d95a9e5e0f3d5f13c1d0aff02fd (patch)
tree59df00589e2f00207b30975db5af144e71bcc1be /device/src/controller.c
parent68e394d1d6dd96885b3102a24e21d9ce397fb133 (diff)
downloadandroid_system_bt-a1bff6f9b63b5d95a9e5e0f3d5f13c1d0aff02fd.tar.gz
android_system_bt-a1bff6f9b63b5d95a9e5e0f3d5f13c1d0aff02fd.tar.bz2
android_system_bt-a1bff6f9b63b5d95a9e5e0f3d5f13c1d0aff02fd.zip
Bluetooth: Read local supported codecs part of boot sequence
- Read local supported codecs as part of controller boot up sequence. - API provided from controller interface to get the local supported codecs. CRs-Fixed: 878963 Change-Id: I37a4ab9e6a20ed057ca794dbdd4f99c2a8c65a6e
Diffstat (limited to 'device/src/controller.c')
-rwxr-xr-x[-rw-r--r--]device/src/controller.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/device/src/controller.c b/device/src/controller.c
index 1938f09aa..e90b4132d 100644..100755
--- a/device/src/controller.c
+++ b/device/src/controller.c
@@ -49,6 +49,7 @@ const uint8_t SCO_HOST_BUFFER_SIZE = 0xff;
#define MAX_FEATURES_CLASSIC_PAGE_COUNT 3
#define BLE_SUPPORTED_STATES_SIZE 8
#define BLE_SUPPORTED_FEATURES_SIZE 8
+#define MAX_LOCAL_SUPPORTED_CODECS_SIZE 8
static const hci_t *hci;
static const hci_packet_factory_t *packet_factory;
@@ -71,6 +72,8 @@ static uint8_t ble_resolving_list_max_size;
static uint8_t ble_supported_states[BLE_SUPPORTED_STATES_SIZE];
static bt_device_features_t features_ble;
static uint16_t ble_suggested_default_data_length;
+static uint8_t local_supported_codecs[MAX_LOCAL_SUPPORTED_CODECS_SIZE];
+static uint8_t no_of_local_supported_codecs = 0;
static bool readable;
static bool ble_supported;
@@ -241,6 +244,14 @@ static future_t *start_up(void) {
packet_parser->parse_generic_command_complete(response);
}
+ // read local supported codecs
+ if( HCI_READ_LOCAL_CODECS_SUPPORTED(supported_commands)) {
+ response = AWAIT_COMMAND(packet_factory->make_read_local_supported_codecs());
+ packet_parser->parse_read_local_supported_codecs_response(
+ response,
+ &no_of_local_supported_codecs, local_supported_codecs);
+ }
+
readable = true;
return future_new_immediate(FUTURE_SUCCESS);
}
@@ -290,6 +301,15 @@ static uint8_t get_last_features_classic_index(void) {
return last_features_classic_page_index;
}
+static uint8_t *get_local_supported_codecs(uint8_t *no_of_codecs) {
+ assert(readable);
+ if( no_of_local_supported_codecs) {
+ *no_of_codecs = no_of_local_supported_codecs;
+ return local_supported_codecs;
+ }
+ else return NULL;
+}
+
static const bt_device_features_t *get_features_ble(void) {
assert(readable);
assert(ble_supported);
@@ -460,7 +480,8 @@ static const controller_t interface = {
get_ble_white_list_size,
get_ble_resolving_list_max_size,
- set_ble_resolving_list_max_size
+ set_ble_resolving_list_max_size,
+ get_local_supported_codecs
};
const controller_t *controller_get_interface() {