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

Commit 76940e16 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I8a2d2fcf,I11b1f3f5,I3329f7fc am: 5d6e8ab4 am: 4f75f68d am:...

Merge changes I8a2d2fcf,I11b1f3f5,I3329f7fc am: 5d6e8ab4 am: 4f75f68d am: 00a1b7f3 am: 1a436d15

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1826992

Change-Id: Iba7e58a89dd90e067b95a6a10cf55f3a0200c60d
parents ed605b5b 1a436d15
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -38,7 +38,15 @@ class ObjectSubject(object):

    def isNotEqualTo(self, other):
        if self._value == other:
            raise signals.TestFailure("Expected \"%s\" to not be equal to \"%s\"" % (self._value, other), extras=None)
            raise signals.TestFailure("Expected \"%s\" not to be equal to \"%s\"" % (self._value, other), extras=None)

    def isGreaterThan(self, other):
        if self._value <= other:
            raise signals.TestFailure("Expected \"%s\" to be greater than \"%s\"" % (self._value, other), extras=None)

    def isLessThan(self, other):
        if self._value >= other:
            raise signals.TestFailure("Expected \"%s\" to be less than \"%s\"" % (self._value, other), extras=None)

    def isNone(self):
        if self._value is not None:
+3 −0
Original line number Diff line number Diff line
@@ -28,3 +28,6 @@ class ControllerTest(GdBaseTestClass, ControllerTestBase):

    def test_write_local_name(self):
        ControllerTestBase.test_write_local_name(self, self.dut, self.cert)

    def test_extended_advertising_support(self):
        ControllerTestBase.test_extended_advertising_support(self, self.dut, self.cert)
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

import time

from bluetooth_packets_python3 import hci_packets
from cert.truth import assertThat
from google.protobuf import empty_pb2 as empty_proto
from facade import rootservice_pb2 as facade_rootservice
@@ -39,3 +40,12 @@ class ControllerTestBase():

        assertThat(dut_name).isEqualTo(b'ImTheDUT')
        assertThat(cert_name).isEqualTo(b'ImTheCert')

    def test_extended_advertising_support(self, dut, cert):
        extended_advertising_supported = dut.hci_controller.SupportsBleExtendedAdvertising(empty_proto.Empty())
        if extended_advertising_supported.supported:
            number_of_sets = dut.hci_controller.GetLeNumberOfSupportedAdvertisingSets(empty_proto.Empty())
            assertThat(number_of_sets.value).isGreaterThan(5)  # Android threshold for CTS
            supported = dut.hci_controller.IsSupportedCommand(
                controller_facade.OpCodeMsg(op_code=int(hci_packets.OpCode.LE_SET_EXTENDED_ADVERTISING_PARAMETERS)))
            assertThat(supported.supported).isEqualTo(True)
+27 −6
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ struct Controller::impl {
      le_resolving_list_size_ = 0;
    }

    if (is_supported(OpCode::LE_READ_MAXIMUM_DATA_LENGTH) && module_.SupportsBlePacketExtension()) {
    if (is_supported(OpCode::LE_READ_MAXIMUM_DATA_LENGTH) && module_.SupportsBleDataPacketLengthExtension()) {
      hci_->EnqueueCommand(LeReadMaximumDataLengthBuilder::Create(),
                           handler->BindOnceOn(this, &Controller::impl::le_read_maximum_data_length_handler));
    } else {
@@ -112,7 +112,7 @@ struct Controller::impl {
            handler->BindOnceOn(this, &Controller::impl::write_secure_connections_host_support_complete_handler));
      }
    }
    if (is_supported(OpCode::LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH) && module_.SupportsBlePacketExtension()) {
    if (is_supported(OpCode::LE_READ_SUGGESTED_DEFAULT_DATA_LENGTH) && module_.SupportsBleDataPacketLengthExtension()) {
      hci_->EnqueueCommand(
          LeReadSuggestedDefaultDataLengthBuilder::Create(),
          handler->BindOnceOn(this, &Controller::impl::le_read_suggested_default_data_length_handler));
@@ -946,21 +946,42 @@ LOCAL_FEATURE_ACCESSOR(SupportsBle, 0, 38)
    return GetLocalLeFeatures() & BIT(bit);  \
  }

LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionParameterRequest, 1)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionParametersRequest, 2)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePeripheralInitiatedFeatureExchange, 3)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePacketExtension, 5)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleEncryption, 0)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionParametersRequest, 1)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleExtendedReject, 2)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePeripheralInitiatedFeaturesExchange, 3)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePing, 4)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleDataPacketLengthExtension, 5)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePrivacy, 6)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleExtendedScannerFilterPolicies, 7)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBle2mPhy, 8)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleStableModulationIndexTx, 9)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleStableModulationIndexRx, 10)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleCodedPhy, 11)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleExtendedAdvertising, 12)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePeriodicAdvertising, 13)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleChannelSelectionAlgorithm2, 14)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePowerClass1, 15)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleMinimumUsedChannels, 16)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionCteRequest, 17)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionCteResponse, 18)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionlessCteTransmitter, 19)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectionlessCteReceiver, 20)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleAntennaSwitchingDuringCteTx, 21)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleAntennaSwitchingDuringCteRx, 22)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleReceivingConstantToneExtensions, 23)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePeriodicAdvertisingSyncTransferSender, 24)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePeriodicAdvertisingSyncTransferRecipient, 25)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleSleepClockAccuracyUpdates, 26)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleRemotePublicKeyValidation, 27)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectedIsochronousStreamCentral, 28)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleConnectedIsochronousStreamPeripheral, 29)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleIsochronousBroadcaster, 30)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleSynchronizedReceiver, 31)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBleIsochronousChannelsHostSupport, 32)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePowerControlRequest, 33)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePowerChangeIndication, 34)
LOCAL_LE_FEATURE_ACCESSOR(SupportsBlePathLossMonitoring, 35)

uint64_t Controller::GetLocalFeatures(uint8_t page_number) const {
  if (page_number <= impl_->maximum_page_number_) {
+26 −5
Original line number Diff line number Diff line
@@ -72,23 +72,44 @@ class Controller : public Module {
  virtual bool SupportsNonFlushablePb() const;
  virtual bool SupportsSniffSubrating() const;
  virtual bool SupportsEncryptionPause() const;

  virtual bool SupportsBle() const;
  virtual bool SupportsBlePrivacy() const;
  virtual bool SupportsBlePacketExtension() const;

  virtual bool SupportsBleEncryption() const;
  virtual bool SupportsBleConnectionParametersRequest() const;
  virtual bool SupportsBleExtendedReject() const;
  virtual bool SupportsBlePeripheralInitiatedFeaturesExchange() const;
  virtual bool SupportsBlePing() const;
  virtual bool SupportsBleDataPacketLengthExtension() const;
  virtual bool SupportsBlePrivacy() const;
  virtual bool SupportsBleExtendedScannerFilterPolicies() const;
  virtual bool SupportsBle2mPhy() const;
  virtual bool SupportsBleStableModulationIndexTx() const;
  virtual bool SupportsBleStableModulationIndexRx() const;
  virtual bool SupportsBleCodedPhy() const;
  virtual bool SupportsBleExtendedAdvertising() const;
  virtual bool SupportsBlePeriodicAdvertising() const;
  virtual bool SupportsBlePeripheralInitiatedFeatureExchange() const;
  virtual bool SupportsBleConnectionParameterRequest() const;
  virtual bool SupportsBleChannelSelectionAlgorithm2() const;
  virtual bool SupportsBlePowerClass1() const;
  virtual bool SupportsBleMinimumUsedChannels() const;
  virtual bool SupportsBleConnectionCteRequest() const;
  virtual bool SupportsBleConnectionCteResponse() const;
  virtual bool SupportsBleConnectionlessCteTransmitter() const;
  virtual bool SupportsBleConnectionlessCteReceiver() const;
  virtual bool SupportsBleAntennaSwitchingDuringCteTx() const;
  virtual bool SupportsBleAntennaSwitchingDuringCteRx() const;
  virtual bool SupportsBleReceivingConstantToneExtensions() const;
  virtual bool SupportsBlePeriodicAdvertisingSyncTransferSender() const;
  virtual bool SupportsBlePeriodicAdvertisingSyncTransferRecipient() const;
  virtual bool SupportsBleSleepClockAccuracyUpdates() const;
  virtual bool SupportsBleRemotePublicKeyValidation() const;
  virtual bool SupportsBleConnectedIsochronousStreamCentral() const;
  virtual bool SupportsBleConnectedIsochronousStreamPeripheral() const;
  virtual bool SupportsBleIsochronousBroadcaster() const;
  virtual bool SupportsBleSynchronizedReceiver() const;
  virtual bool SupportsBleIsochronousChannelsHostSupport() const;
  virtual bool SupportsBlePowerControlRequest() const;
  virtual bool SupportsBlePowerChangeIndication() const;
  virtual bool SupportsBlePathLossMonitoring() const;

  virtual uint16_t GetAclPacketLength() const;

Loading