Skip to content
Snippets Groups Projects
Commit 3b2b2eed authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

GD: enable ISO host support and CIS required event

Without these two enabled, LE Audio fails to start a stream.

Test: run LE Audio with GD controller enabled
Bug: 150670922
Change-Id: I5878084f603b21d6be0811d529a39be58269eeba
parent e2670366
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,11 @@ struct Controller::impl {
LOG_INFO("LE_READ_PERIODIC_ADVERTISING_LIST_SIZE not supported, defaulting to 0");
le_periodic_advertiser_list_size_ = 0;
}
if (is_supported(OpCode::LE_SET_HOST_FEATURE)) {
hci_->EnqueueCommand(
LeSetHostFeatureBuilder::Create(LeHostFeatureBits::CONNECTED_ISO_STREAM_HOST_SUPPORT, Enable::ENABLED),
handler->BindOnceOn(this, &Controller::impl::le_set_host_feature_handler));
}
hci_->EnqueueCommand(LeGetVendorCapabilitiesBuilder::Create(),
handler->BindOnceOn(this, &Controller::impl::le_get_vendor_capabilities_handler));
......@@ -324,6 +329,13 @@ struct Controller::impl {
}
}
void le_set_host_feature_handler(CommandCompleteView view) {
auto complete_view = LeSetHostFeatureCompleteView::Create(view);
ASSERT(complete_view.IsValid());
ErrorCode status = complete_view.GetStatus();
ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
}
void le_read_local_supported_features_handler(CommandCompleteView view) {
auto complete_view = LeReadLocalSupportedFeaturesCompleteView::Create(view);
ASSERT(complete_view.IsValid());
......
......@@ -159,7 +159,7 @@ class Controller : public Module {
static const ModuleFactory Factory;
static constexpr uint64_t kDefaultEventMask = 0x3dbfffffffffffff;
static constexpr uint64_t kDefaultLeEventMask = 0x0000000000021e7f;
static constexpr uint64_t kDefaultLeEventMask = 0x0000000041021e7f;
protected:
void ListDependencies(ModuleList* list) override;
......
......@@ -4269,8 +4269,12 @@ packet LeRemoveIsoDataPathComplete : CommandComplete (command_op_code = LE_REMOV
_reserved_ : 4,
}
enum LeHostFeatureBits : 8 {
CONNECTED_ISO_STREAM_HOST_SUPPORT = 32,
}
packet LeSetHostFeature : Command (op_code = LE_SET_HOST_FEATURE) {
bit_number : 8,
bit_number : LeHostFeatureBits,
bit_value: Enable,
}
......
......@@ -2,15 +2,16 @@
use crate::{Address, CommandSender};
use bt_packets::hci::{
Enable, ErrorCode, LeMaximumDataLength, LeReadBufferSizeV1Builder, LeReadBufferSizeV2Builder,
LeReadConnectListSizeBuilder, LeReadLocalSupportedFeaturesBuilder,
Enable, ErrorCode, LeHostFeatureBits, LeMaximumDataLength, LeReadBufferSizeV1Builder,
LeReadBufferSizeV2Builder, LeReadConnectListSizeBuilder, LeReadLocalSupportedFeaturesBuilder,
LeReadMaximumAdvertisingDataLengthBuilder, LeReadMaximumDataLengthBuilder,
LeReadNumberOfSupportedAdvertisingSetsBuilder, LeReadPeriodicAdvertiserListSizeBuilder,
LeReadResolvingListSizeBuilder, LeReadSuggestedDefaultDataLengthBuilder,
LeReadSupportedStatesBuilder, LeSetEventMaskBuilder, LocalVersionInformation, OpCode,
OpCodeIndex, ReadBdAddrBuilder, ReadBufferSizeBuilder, ReadLocalExtendedFeaturesBuilder,
ReadLocalNameBuilder, ReadLocalSupportedCommandsBuilder, ReadLocalVersionInformationBuilder,
SetEventMaskBuilder, WriteLeHostSupportBuilder, WriteSimplePairingModeBuilder,
LeReadSupportedStatesBuilder, LeSetEventMaskBuilder, LeSetHostFeatureBuilder,
LocalVersionInformation, OpCode, OpCodeIndex, ReadBdAddrBuilder, ReadBufferSizeBuilder,
ReadLocalExtendedFeaturesBuilder, ReadLocalNameBuilder, ReadLocalSupportedCommandsBuilder,
ReadLocalVersionInformationBuilder, SetEventMaskBuilder, WriteLeHostSupportBuilder,
WriteSimplePairingModeBuilder,
};
use gddi::{module, provides, Stoppable};
use num_traits::ToPrimitive;
......@@ -35,7 +36,7 @@ macro_rules! assert_success {
#[provides]
async fn provide_controller(mut hci: CommandSender) -> Arc<ControllerExports> {
assert_success!(hci.send(LeSetEventMaskBuilder { le_event_mask: 0x0000000000021e7f }));
assert_success!(hci.send(LeSetEventMaskBuilder { le_event_mask: 0x0000000041021e7f }));
assert_success!(hci.send(SetEventMaskBuilder { event_mask: 0x3dbfffffffffffff }));
assert_success!(
hci.send(WriteSimplePairingModeBuilder { simple_pairing_mode: Enable::Enabled })
......@@ -142,6 +143,13 @@ async fn provide_controller(mut hci: CommandSender) -> Arc<ControllerExports> {
0
};
if commands.is_supported(OpCode::LeSetHostFeature) {
assert_success!(hci.send(LeSetHostFeatureBuilder {
bit_number: LeHostFeatureBits::ConnectedIsoStreamHostSupport,
bit_value: Enable::Enabled
}));
}
let address = assert_success!(hci.send(ReadBdAddrBuilder {})).get_bd_addr();
Arc::new(ControllerExports {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment