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

Commit a81620a2 authored by Grace Cham's avatar Grace Cham
Browse files

PDL: rename hci_packages enums

* DirectAdvertisingAddressType::NO_ADDRESS{=>_PROVIDED}
* PacketStatusFlag::NO_DATA{=>_RECEIVED}

libchrome started to include libevent.h from r1033946
(crrev.com/c/3811220) and hence indirectly include netdb.h, which
defines macro NO_DATA and NO_ADDRESS. This causes compile error in floss
when they are used in the enums.

Use NO_ADDRESS_PROVIDED and NO_DATA_RECEIVED to be consistent with the
spec (downloadable from
https://www.bluetooth.com/specifications/specs/core-specification-5-3/,
page 2272 and 1814 respectively)

BUG: 253138188
Tag: #floss
Test: emerge-hatch libchrome floss
Change-Id: I493017f800ffddab2a24d8cf3324d8e21e96aee0
parent 27d6d49e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ packet Acl {
enum PacketStatusFlag : 2 {
  CORRECTLY_RECEIVED = 0,
  POSSIBLY_INCOMPLETE = 1,
  NO_DATA = 2,
  NO_DATA_RECEIVED = 2,
  PARTIALLY_LOST = 3,
}

@@ -5655,7 +5655,7 @@ enum DirectAdvertisingAddressType : 8 {
  PUBLIC_IDENTITY_ADDRESS = 0x02,
  RANDOM_IDENTITY_ADDRESS = 0x03,
  CONTROLLER_UNABLE_TO_RESOLVE = 0xFE,
  NO_ADDRESS = 0xFF,
  NO_ADDRESS_PROVIDED = 0xFF,
}

enum DirectAdvertisingEventType : 8 {
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
      }
    }

    if (address_type == (uint8_t)DirectAdvertisingAddressType::NO_ADDRESS) {
    if (address_type == (uint8_t)DirectAdvertisingAddressType::NO_ADDRESS_PROVIDED) {
      scanning_callbacks_->OnScanResult(
          event_type,
          address_type,
+1 −1
Original line number Diff line number Diff line
@@ -1890,7 +1890,7 @@ void LinkLayerController::IncomingLeLegacyAdvertisingPdu(
    response.rssi_ = rssi;
    response.periodic_advertising_interval_ = 0;  // No periodic advertising.
    response.direct_address_type_ =
        bluetooth::hci::DirectAdvertisingAddressType::NO_ADDRESS;
        bluetooth::hci::DirectAdvertisingAddressType::NO_ADDRESS_PROVIDED;
    response.direct_address_ = Address::kEmpty;
    response.advertising_data_ = advertising_data;