Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f2fc457 authored by Erwin Jansen's avatar Erwin Jansen
Browse files

Enable missing HCI cmds in rootcanal

This enables:

- 7.8.44 LE Set Address Resolution Enable command
- 7.8.45 LE Set Resolvable Private Address Timeout

Both are NOPs for now.

Bug: 186861350
Bug: 186541528
Test: NimBLE gets a bit further with root canal
Change-Id: I3d1b95a30afc97d1f1f7555ac891b4f4df872eec
parent 580b52b2
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -289,6 +289,8 @@ DualModeController::DualModeController(const std::string& properties_filename, u
  SET_SUPPORTED(READ_VOICE_SETTING, ReadVoiceSetting);
  SET_SUPPORTED(READ_CONNECTION_ACCEPT_TIMEOUT, ReadConnectionAcceptTimeout);
  SET_SUPPORTED(WRITE_CONNECTION_ACCEPT_TIMEOUT, WriteConnectionAcceptTimeout);
  SET_SUPPORTED(LE_SET_ADDRESS_RESOLUTION_ENABLE, LeSetAddressResolutionEnable);
  SET_SUPPORTED(LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT, LeSetResovalablePrivateAddressTimeout);
#undef SET_HANDLER
#undef SET_SUPPORTED
  properties_.SetSupportedCommands(supported_commands);
@@ -1570,6 +1572,24 @@ void DualModeController::LeReadBufferSize(CommandView command) {
  send_event_(std::move(packet));
}

void DualModeController::LeSetAddressResolutionEnable(CommandView command) {
    // NOP
    auto payload =
      std::make_unique<bluetooth::packet::RawBuilder>(std::vector<uint8_t>(
          {static_cast<uint8_t>(bluetooth::hci::ErrorCode::SUCCESS)}));
  send_event_(bluetooth::hci::CommandCompleteBuilder::Create(
      kNumCommandPackets, command.GetOpCode(), std::move(payload)));
}

void DualModeController::LeSetResovalablePrivateAddressTimeout(CommandView command) {
    // NOP
    auto payload =
      std::make_unique<bluetooth::packet::RawBuilder>(std::vector<uint8_t>(
          {static_cast<uint8_t>(bluetooth::hci::ErrorCode::SUCCESS)}));
  send_event_(bluetooth::hci::CommandCompleteBuilder::Create(
      kNumCommandPackets, command.GetOpCode(), std::move(payload)));
}

void DualModeController::LeReadLocalSupportedFeatures(CommandView command) {
  auto command_view = gd_hci::LeReadLocalSupportedFeaturesView::Create(command);
  ASSERT(command_view.IsValid());
+6 −0
Original line number Diff line number Diff line
@@ -478,6 +478,12 @@ class DualModeController : public Device {
  // 7.8.41
  void LeReadResolvingListSize(CommandView args);

  // 7.8.44
  void LeSetAddressResolutionEnable(CommandView args);

  // 7.8.45
  void LeSetResovalablePrivateAddressTimeout(CommandView args);

  // 7.8.46
  void LeReadMaximumDataLength(CommandView args);