diff options
author | Srinu Jella <sjella@codeaurora.org> | 2015-08-24 21:00:28 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:22:09 -0600 |
commit | fcbb22034e2b8fb499484c135845ea7072d06d50 (patch) | |
tree | 96f7bcde3384e445aee69ce30fa52f225686fb7c /device/src | |
parent | 71b5defa5889fb9cf79faf776ce8d37477ded773 (diff) | |
download | android_system_bt-fcbb22034e2b8fb499484c135845ea7072d06d50.tar.gz android_system_bt-fcbb22034e2b8fb499484c135845ea7072d06d50.tar.bz2 android_system_bt-fcbb22034e2b8fb499484c135845ea7072d06d50.zip |
Bluetooth: Read BLE vendor capability to proceed on Secure conn
- Read BLE vendor capability to proceed on enablement of
secure connection support from Host.
- If BLE vendor capability is supported from the controller
then secure connection is enabled from Host.
CRs-Fixed: 900778
Change-Id: I64e79d4e6fff7d9f1b0ea7272250e8155f5888e2
Diffstat (limited to 'device/src')
-rwxr-xr-x | device/src/controller.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/device/src/controller.c b/device/src/controller.c index da739cd7f..df00d68c6 100755 --- a/device/src/controller.c +++ b/device/src/controller.c @@ -77,6 +77,7 @@ static uint8_t no_of_local_supported_codecs = 0; static bool readable; static bool ble_supported; +static bool ble_offload_features_supported; static bool simple_pairing_supported; static bool secure_connections_supported; @@ -183,11 +184,17 @@ static future_t *start_up(void) { page_number++; } + // read BLE offload features support from controller + response = AWAIT_COMMAND(packet_factory->make_ble_read_offload_features_support()); + packet_parser->parse_ble_read_offload_features_response(response, &ble_offload_features_supported); + #if (SC_MODE_INCLUDED == TRUE) - secure_connections_supported = HCI_SC_CTRLR_SUPPORTED(features_classic[2].as_array); - if (secure_connections_supported) { - response = AWAIT_COMMAND(packet_factory->make_write_secure_connections_host_support(HCI_SC_MODE_ENABLED)); - packet_parser->parse_generic_command_complete(response); + if(ble_offload_features_supported) { + secure_connections_supported = HCI_SC_CTRLR_SUPPORTED(features_classic[2].as_array); + if (secure_connections_supported) { + response = AWAIT_COMMAND(packet_factory->make_write_secure_connections_host_support(HCI_SC_MODE_ENABLED)); + packet_parser->parse_generic_command_complete(response); + } } #endif @@ -391,6 +398,12 @@ static bool supports_ble_connection_parameters_request(void) { return HCI_LE_CONN_PARAM_REQ_SUPPORTED(features_ble.as_array); } +static bool supports_ble_offload_features(void) { + assert(readable); + assert(ble_supported); + return ble_offload_features_supported; +} + static uint16_t get_acl_data_size_classic(void) { assert(readable); return acl_data_size_classic; @@ -487,7 +500,8 @@ static const controller_t interface = { get_ble_resolving_list_max_size, set_ble_resolving_list_max_size, - get_local_supported_codecs + get_local_supported_codecs, + supports_ble_offload_features }; const controller_t *controller_get_interface() { |