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

Commit 13b5da64 authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge "HCI: Add SetEventMaskPage2 Opcode"

parents d5912836 2035b901
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -655,6 +655,7 @@ struct Controller::impl {
      OP_CODE_MAPPING(WRITE_SIMPLE_PAIRING_DEBUG_MODE)
      OP_CODE_MAPPING(WRITE_SIMPLE_PAIRING_DEBUG_MODE)
      OP_CODE_MAPPING(REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY)
      OP_CODE_MAPPING(REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY)
      OP_CODE_MAPPING(SEND_KEYPRESS_NOTIFICATION)
      OP_CODE_MAPPING(SEND_KEYPRESS_NOTIFICATION)
      OP_CODE_MAPPING(SET_EVENT_MASK_PAGE_2)
      OP_CODE_MAPPING(IO_CAPABILITY_REQUEST_NEGATIVE_REPLY)
      OP_CODE_MAPPING(IO_CAPABILITY_REQUEST_NEGATIVE_REPLY)
      OP_CODE_MAPPING(REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY)
      OP_CODE_MAPPING(REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY)
      OP_CODE_MAPPING(READ_ENCRYPTION_KEY_SIZE)
      OP_CODE_MAPPING(READ_ENCRYPTION_KEY_SIZE)
+4 −0
Original line number Original line Diff line number Diff line
@@ -226,6 +226,9 @@ enum OpCode : 16 {
  ENHANCED_FLUSH = 0x0C5F,
  ENHANCED_FLUSH = 0x0C5F,
  SEND_KEYPRESS_NOTIFICATION = 0x0C60,
  SEND_KEYPRESS_NOTIFICATION = 0x0C60,


  // Allow stacks to disable AMP events
  SET_EVENT_MASK_PAGE_2 = 0x0C63,

  READ_LE_HOST_SUPPORT = 0x0C6C,
  READ_LE_HOST_SUPPORT = 0x0C6C,
  WRITE_LE_HOST_SUPPORT = 0x0C6D,
  WRITE_LE_HOST_SUPPORT = 0x0C6D,


@@ -515,6 +518,7 @@ enum OpCodeIndex : 16 {
  SEND_KEYPRESS_NOTIFICATION = 202,
  SEND_KEYPRESS_NOTIFICATION = 202,
  IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 203,
  IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 203,
  READ_ENCRYPTION_KEY_SIZE = 204,
  READ_ENCRYPTION_KEY_SIZE = 204,
  SET_EVENT_MASK_PAGE_2 = 222,
  READ_DATA_BLOCK_SIZE = 232,
  READ_DATA_BLOCK_SIZE = 232,
  READ_LE_HOST_SUPPORT = 245,
  READ_LE_HOST_SUPPORT = 245,
  WRITE_LE_HOST_SUPPORT = 246,
  WRITE_LE_HOST_SUPPORT = 246,
+9 −0
Original line number Original line Diff line number Diff line
@@ -146,6 +146,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u
  SET_SUPPORTED(READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL,
  SET_SUPPORTED(READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL,
                ReadInquiryResponseTransmitPowerLevel);
                ReadInquiryResponseTransmitPowerLevel);
  SET_SUPPORTED(SEND_KEYPRESS_NOTIFICATION, SendKeypressNotification);
  SET_SUPPORTED(SEND_KEYPRESS_NOTIFICATION, SendKeypressNotification);
  SET_HANDLER(SET_EVENT_MASK_PAGE_2, SetEventMaskPage2);
  SET_SUPPORTED(READ_LOCAL_OOB_DATA, ReadLocalOobData);
  SET_SUPPORTED(READ_LOCAL_OOB_DATA, ReadLocalOobData);
  SET_SUPPORTED(READ_LOCAL_OOB_EXTENDED_DATA, ReadLocalOobExtendedData);
  SET_SUPPORTED(READ_LOCAL_OOB_EXTENDED_DATA, ReadLocalOobExtendedData);
  SET_SUPPORTED(WRITE_SIMPLE_PAIRING_MODE, WriteSimplePairingMode);
  SET_SUPPORTED(WRITE_SIMPLE_PAIRING_MODE, WriteSimplePairingMode);
@@ -854,6 +855,14 @@ void DualModeController::SendKeypressNotification(CommandView command) {
      kNumCommandPackets, status, peer));
      kNumCommandPackets, status, peer));
}
}


void DualModeController::SetEventMaskPage2(CommandView command) {
  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::ReadLocalOobData(CommandView command) {
void DualModeController::ReadLocalOobData(CommandView command) {
  auto command_view = gd_hci::ReadLocalOobDataView::Create(
  auto command_view = gd_hci::ReadLocalOobDataView::Create(
      gd_hci::SecurityCommandView::Create(command));
      gd_hci::SecurityCommandView::Create(command));
+3 −0
Original line number Original line Diff line number Diff line
@@ -337,6 +337,9 @@ class DualModeController : public Device {
  // 7.3.63
  // 7.3.63
  void SendKeypressNotification(CommandView args);
  void SendKeypressNotification(CommandView args);


  // 7.3.69
  void SetEventMaskPage2(CommandView args);

  // 7.3.79
  // 7.3.79
  void WriteLeHostSupport(CommandView args);
  void WriteLeHostSupport(CommandView args);