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

Commit 0b611f1d authored by Myles Watson's avatar Myles Watson Committed by Automerger Merge Worker
Browse files

Merge changes I1e5a5a5a,Ibc90196e,I2bbc1b6a am: 14a3d390

parents d3ff6e7e 14a3d390
Loading
Loading
Loading
Loading
+53 −1
Original line number Diff line number Diff line
@@ -803,7 +803,7 @@ enum ErrorCode: 8 {
  CONNECTION_REJECTED_SECURITY_REASONS = 0x0E,
  CONNECTION_REJECTED_UNACCEPTABLE_BD_ADDR = 0x0F,
  CONNECTION_ACCEPT_TIMEOUT = 0x10,
  UNSUPORTED_FEATURE_OR_PARAMETER_VALUE = 0x11,
  UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE = 0x11,
  INVALID_HCI_COMMAND_PARAMETERS = 0x12,
  REMOTE_USER_TERMINATED_CONNECTION = 0x13,
  REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES = 0x14,
@@ -2994,6 +2994,58 @@ test LeReadBufferSizeV1Complete {
  "\x0e\x07\x01\x02\x20\x00\xfb\x00\x10",
}

enum LLFeaturesBits : 64 {
  // Byte 0
  LE_ENCRYPTION                                 = 0x0000000000000001,
  CONNECTION_PARAMETERS_REQUEST_PROCEDURE       = 0x0000000000000002,
  EXTENDED_REJECT_INDICATION                    = 0x0000000000000004,
  PERIPHERAL_INITIATED_FEATURES_EXCHANGE        = 0x0000000000000008,
  LE_PING                                       = 0x0000000000000010,
  LE_DATA_PACKET_LENGTH_EXTENSION               = 0x0000000000000020,
  LL_PRIVACY                                    = 0x0000000000000040,
  EXTENDED_SCANNER_FILTER_POLICIES              = 0x0000000000000080,

  // Byte 1
  LE_2M_PHY                                     = 0x0000000000000100,
  STABLE_MODULATION_INDEX_TRANSMITTER           = 0x0000000000000200,
  STABLE_MODULATION_INDEX_RECEIVER              = 0x0000000000000400,
  LE_CODED_PHY                                  = 0x0000000000000800,
  LE_EXTENDED_ADVERTISING                       = 0x0000000000001000,
  LE_PERIODIC_ADVERTISING                       = 0x0000000000002000,
  CHANNEL_SELECTION_ALGORITHM_2                 = 0x0000000000004000,
  LE_POWER_CLASS_1                              = 0x0000000000008000,

  // Byte 2
  MINIMUM_NUMBER_OF_USED_CHANNELS_PROCEDURE     = 0x0000000000010000,
  CONNECTION_CTE_REQUEST                        = 0x0000000000020000,
  CONNECTION_CTE_RESPONSE                       = 0x0000000000040000,
  CONNECTIONLESS_CTE_TRANSMITTER                = 0x0000000000080000,
  CONNECTIONLESS_CTE_RECEIVER                   = 0x0000000000100000,
  ANTENNA_SWITCHING_DURING_CTE_TRANSMISSION     = 0x0000000000200000,
  ANTENNA_SWITCHING_DURING_CTE_RECEPTION        = 0x0000000000400000,
  RECEIVING_CONSTANT_TONE_EXTENSIONS            = 0x0000000000800000,

  // Byte 3
  PERIODIC_ADVERTISING_SYNC_TRANSFER_SENDER     = 0x0000000001000000,
  PERIODIC_ADVERTISING_SYNC_TRANSFER_RECIPIENT  = 0x0000000002000000,
  SLEEP_CLOCK_ACCURACY_UPDATES                  = 0x0000000004000000,
  REMOTE_PUBLIC_KEY_VALIDATION                  = 0x0000000008000000,
  CONNECTED_ISOCHRONOUS_STREAM_CENTRAL          = 0x0000000010000000,
  CONNECTED_ISOCHRONOUS_STREAM_PERIPHERAL       = 0x0000000020000000,
  ISOCHRONOUS_BROADCASTER                       = 0x0000000040000000,
  SYNCHRONIZED_RECEIVER                         = 0x0000000080000000,

  // Byte 4
  CONNECTED_ISOCHRONOUS_STREAM_HOST_SUPPORT     = 0x0000000100000000,
  LE_POWER_CONTROL_REQUEST                      = 0x0000000200000000,
  LE_POWER_CONTROL_REQUEST_BIS                  = 0x0000000400000000,
  LE_PATH_LOSS_MONITORING                       = 0x0000000800000000,
  PERIODIC_ADVERTISING_ADI_SUPPORT              = 0x0000001000000000,
  CONNECTION_SUBRATING                          = 0x0000002000000000,
  CONNECTION_SUBRATING_HOST_SUPPORT             = 0x0000004000000000,
  CHANNEL_CLASSIFICATION                        = 0x0000008000000000,
}

packet LeReadLocalSupportedFeatures : Command (op_code = LE_READ_LOCAL_SUPPORTED_FEATURES) {
}

+1 −1
Original line number Diff line number Diff line
@@ -1017,7 +1017,7 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
  void batch_scan_read_results(ScannerId scanner_id, uint16_t total_num_of_records, BatchScanMode scan_mode) {
    if (!is_batch_scan_support_) {
      LOG_WARN("Batch scan is not supported");
      int status = static_cast<int>(ErrorCode::UNSUPORTED_FEATURE_OR_PARAMETER_VALUE);
      int status = static_cast<int>(ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE);
      scanning_callbacks_->OnBatchScanReports(scanner_id, status, 0, 0, {});
      return;
    }
+2 −2
Original line number Diff line number Diff line
@@ -180,9 +180,9 @@ inline tHCI_STATUS ToLegacyHciErrorCode(const hci::ErrorCode& reason) {
      return HCI_ERR_HOST_REJECT_DEVICE;
    case hci::ErrorCode::CONNECTION_ACCEPT_TIMEOUT:
      return HCI_ERR_HOST_TIMEOUT;
    case hci::ErrorCode::UNSUPORTED_FEATURE_OR_PARAMETER_VALUE:
    case hci::ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE:
      return static_cast<tHCI_STATUS>(
          hci::ErrorCode::UNSUPORTED_FEATURE_OR_PARAMETER_VALUE);
          hci::ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE);
    case hci::ErrorCode::INVALID_HCI_COMMAND_PARAMETERS:
      return HCI_ERR_ILLEGAL_PARAMETER_FMT;
    case hci::ErrorCode::REMOTE_USER_TERMINATED_CONNECTION:
+20 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ DualModeController::DualModeController(const std::string& properties_filename,
  SET_SUPPORTED(DELETE_STORED_LINK_KEY, DeleteStoredLinkKey);
  SET_SUPPORTED(REMOTE_NAME_REQUEST, RemoteNameRequest);
  SET_SUPPORTED(LE_SET_EVENT_MASK, LeSetEventMask);
  SET_SUPPORTED(LE_SET_HOST_FEATURE, LeSetHostFeature);
  SET_SUPPORTED(LE_READ_BUFFER_SIZE_V1, LeReadBufferSize);
  SET_SUPPORTED(LE_READ_BUFFER_SIZE_V2, LeReadBufferSizeV2);
  SET_SUPPORTED(LE_READ_LOCAL_SUPPORTED_FEATURES, LeReadLocalSupportedFeatures);
@@ -1598,6 +1599,20 @@ void DualModeController::LeSetEventMask(CommandView command) {
      kNumCommandPackets, ErrorCode::SUCCESS));
}

void DualModeController::LeSetHostFeature(CommandView command) {
  auto command_view = gd_hci::LeSetHostFeatureView::Create(command);
  ASSERT(command_view.IsValid());
  // TODO: if the controller has active connections, return COMMAND_DISALLOED
  ErrorCode error_code =
      properties_.SetLeHostFeature(
          static_cast<uint8_t>(command_view.GetBitNumber()),
          static_cast<uint8_t>(command_view.GetBitValue()))
          ? ErrorCode::SUCCESS
          : ErrorCode::UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
  send_event_(bluetooth::hci::LeSetHostFeatureCompleteBuilder::Create(
      kNumCommandPackets, error_code));
}

void DualModeController::LeReadBufferSize(CommandView command) {
  auto command_view = gd_hci::LeReadBufferSizeV1View::Create(command);
  ASSERT(command_view.IsValid());
@@ -1652,6 +1667,11 @@ void DualModeController::LeSetResovalablePrivateAddressTimeout(
void DualModeController::LeReadLocalSupportedFeatures(CommandView command) {
  auto command_view = gd_hci::LeReadLocalSupportedFeaturesView::Create(command);
  ASSERT(command_view.IsValid());
  LOG_INFO(
      "%s | LeReadLocalSupportedFeatures (%016llx)",
      properties_.GetAddress().ToString().c_str(),
      static_cast<unsigned long long>(properties_.GetLeSupportedFeatures()));

  send_event_(
      bluetooth::hci::LeReadLocalSupportedFeaturesCompleteBuilder::Create(
          kNumCommandPackets, ErrorCode::SUCCESS,
+3 −0
Original line number Diff line number Diff line
@@ -586,6 +586,9 @@ class DualModeController : public Device {
  void LeSetupIsoDataPath(CommandView packet_view);
  void LeRemoveIsoDataPath(CommandView packet_view);

  // 7.8.115
  void LeSetHostFeature(CommandView packet_view);

  // Vendor-specific Commands

  void LeVendorSleepMode(CommandView args);
Loading