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

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

Merge "PDL: Unify the declaration scope for Packet and Struct declarations"...

Merge "PDL: Unify the declaration scope for Packet and Struct declarations" am: 1ff41c14 am: 83608117 am: 4b41a3ce am: e9274339

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2056563



Change-Id: I379566ad51fe463ee0e66c7b66cd6530b400c8ee
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d23508da e9274339
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -242,7 +242,7 @@ class NeighborMatchers(object):
        inquiry_view = hci_packets.InquiryResultView(hci_event)
        inquiry_view = hci_packets.InquiryResultView(hci_event)
        if inquiry_view is None:
        if inquiry_view is None:
            return False
            return False
        results = inquiry_view.GetInquiryResults()
        results = inquiry_view.GetResponses()
        return any((address == result.bd_addr for result in results))
        return any((address == result.bd_addr for result in results))


    @staticmethod
    @staticmethod
@@ -257,7 +257,7 @@ class NeighborMatchers(object):
        inquiry_view = hci_packets.InquiryResultWithRssiView(hci_event)
        inquiry_view = hci_packets.InquiryResultWithRssiView(hci_event)
        if inquiry_view is None:
        if inquiry_view is None:
            return False
            return False
        results = inquiry_view.GetInquiryResults()
        results = inquiry_view.GetResponses()
        return any((address == result.address for result in results))
        return any((address == result.address for result in results))


    @staticmethod
    @staticmethod
+1 −1
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ void HciProcessor::process_special_event(
      if (!packet_view.IsValid()) {
      if (!packet_view.IsValid()) {
        return;
        return;
      }
      }
      auto inquiry_results = packet_view.GetInquiryResults();
      auto inquiry_results = packet_view.GetResponses();
      avg_byte_count = byte_count / inquiry_results.size();
      avg_byte_count = byte_count / inquiry_results.size();
      for (auto& inquiry_result : inquiry_results) {
      for (auto& inquiry_result : inquiry_results) {
        btaa_hci_packets.push_back(BtaaHciPacket(Activity::SCAN, inquiry_result.bd_addr_, avg_byte_count));
        btaa_hci_packets.push_back(BtaaHciPacket(Activity::SCAN, inquiry_result.bd_addr_, avg_byte_count));
+2 −2
Original line number Original line Diff line number Diff line
@@ -124,8 +124,8 @@ class LeScanningManagerFacadeService : public LeScanningManagerFacade::Service,
      uint16_t periodic_advertising_interval,
      uint16_t periodic_advertising_interval,
      std::vector<uint8_t> advertising_data) {
      std::vector<uint8_t> advertising_data) {
    AdvertisingReportMsg advertising_report_msg;
    AdvertisingReportMsg advertising_report_msg;
    std::vector<LeExtendedAdvertisingReport> advertisements;
    std::vector<LeExtendedAdvertisingResponse> advertisements;
    LeExtendedAdvertisingReport le_extended_advertising_report;
    LeExtendedAdvertisingResponse le_extended_advertising_report;
    le_extended_advertising_report.address_type_ = (DirectAdvertisingAddressType)address_type;
    le_extended_advertising_report.address_type_ = (DirectAdvertisingAddressType)address_type;
    le_extended_advertising_report.address_ = address;
    le_extended_advertising_report.address_ = address;
    le_extended_advertising_report.advertising_data_ = advertising_data;
    le_extended_advertising_report.advertising_data_ = advertising_data;
+18 −18
Original line number Original line Diff line number Diff line
@@ -4959,7 +4959,7 @@ packet InquiryComplete : Event (event_code = INQUIRY_COMPLETE) {
  status : ErrorCode,
  status : ErrorCode,
}
}


struct InquiryResult {
struct InquiryResponse {
  bd_addr : Address,
  bd_addr : Address,
  page_scan_repetition_mode : PageScanRepetitionMode,
  page_scan_repetition_mode : PageScanRepetitionMode,
  _reserved_ : 8,
  _reserved_ : 8,
@@ -4970,8 +4970,8 @@ struct InquiryResult {
}
}


packet InquiryResult : Event (event_code = INQUIRY_RESULT) {
packet InquiryResult : Event (event_code = INQUIRY_RESULT) {
  _count_(inquiry_results) : 8,
  _count_(responses) : 8,
  inquiry_results : InquiryResult[],
  responses : InquiryResponse[],
}
}


enum LinkType : 8 {
enum LinkType : 8 {
@@ -5197,7 +5197,7 @@ packet FlowSpecificationComplete : Event (event_code = FLOW_SPECIFICATION_COMPLE
  access_latency : 32, // Octets/s
  access_latency : 32, // Octets/s
}
}


struct InquiryResultWithRssi {
struct InquiryResponseWithRssi {
  address : Address,
  address : Address,
  page_scan_repetition_mode : PageScanRepetitionMode,
  page_scan_repetition_mode : PageScanRepetitionMode,
  _reserved_ : 8,
  _reserved_ : 8,
@@ -5208,8 +5208,8 @@ struct InquiryResultWithRssi {
}
}


packet InquiryResultWithRssi : Event (event_code = INQUIRY_RESULT_WITH_RSSI) {
packet InquiryResultWithRssi : Event (event_code = INQUIRY_RESULT_WITH_RSSI) {
  _count_(inquiry_results) : 8,
  _count_(responses) : 8,
  inquiry_results : InquiryResultWithRssi[],
  responses : InquiryResponseWithRssi[],
}
}


packet ReadRemoteExtendedFeaturesComplete : Event (event_code = READ_REMOTE_EXTENDED_FEATURES_COMPLETE) {
packet ReadRemoteExtendedFeaturesComplete : Event (event_code = READ_REMOTE_EXTENDED_FEATURES_COMPLETE) {
@@ -5403,7 +5403,7 @@ enum AdvertisingEventType : 8 {
  SCAN_RESPONSE = 0x04,
  SCAN_RESPONSE = 0x04,
}
}


struct LeAdvertisingReport {
struct LeAdvertisingResponse {
  event_type : AdvertisingEventType,
  event_type : AdvertisingEventType,
  address_type : AddressType,
  address_type : AddressType,
  address : Address,
  address : Address,
@@ -5413,11 +5413,11 @@ struct LeAdvertisingReport {
}
}


packet LeAdvertisingReport : LeMetaEvent (subevent_code = ADVERTISING_REPORT) {
packet LeAdvertisingReport : LeMetaEvent (subevent_code = ADVERTISING_REPORT) {
  _count_(advertising_reports) : 8,
  _count_(responses) : 8,
  advertising_reports : LeAdvertisingReport[],
  responses : LeAdvertisingResponse[],
}
}


struct LeAdvertisingReportRaw {
struct LeAdvertisingResponseRaw {
  event_type : AdvertisingEventType,
  event_type : AdvertisingEventType,
  address_type : AddressType,
  address_type : AddressType,
  address : Address,
  address : Address,
@@ -5427,8 +5427,8 @@ struct LeAdvertisingReportRaw {
}
}


packet LeAdvertisingReportRaw : LeMetaEvent (subevent_code = ADVERTISING_REPORT) {
packet LeAdvertisingReportRaw : LeMetaEvent (subevent_code = ADVERTISING_REPORT) {
  _count_(advertising_reports) : 8,
  _count_(responses) : 8,
  advertising_reports : LeAdvertisingReportRaw[],
  responses : LeAdvertisingResponseRaw[],
}
}


packet LeConnectionUpdateComplete : LeMetaEvent (subevent_code = CONNECTION_UPDATE_COMPLETE) {
packet LeConnectionUpdateComplete : LeMetaEvent (subevent_code = CONNECTION_UPDATE_COMPLETE) {
@@ -5514,7 +5514,7 @@ enum DirectAddressType : 8 {
  RANDOM_DEVICE_ADDRESS = 0x01,
  RANDOM_DEVICE_ADDRESS = 0x01,
}
}


struct LeDirectedAdvertisingReport {
struct LeDirectedAdvertisingResponse {
  event_type : DirectAdvertisingEventType,
  event_type : DirectAdvertisingEventType,
  address_type : DirectAdvertisingAddressType,
  address_type : DirectAdvertisingAddressType,
  address : Address,
  address : Address,
@@ -5524,8 +5524,8 @@ struct LeDirectedAdvertisingReport {
}
}


packet LeDirectedAdvertisingReport : LeMetaEvent (subevent_code = DIRECTED_ADVERTISING_REPORT) {
packet LeDirectedAdvertisingReport : LeMetaEvent (subevent_code = DIRECTED_ADVERTISING_REPORT) {
  _count_(advertising_reports) : 8,
  _count_(responses) : 8,
  advertising_reports : LeDirectedAdvertisingReport[],
  responses : LeDirectedAdvertisingResponse[],
}
}


packet LePhyUpdateComplete : LeMetaEvent (subevent_code = PHY_UPDATE_COMPLETE) {
packet LePhyUpdateComplete : LeMetaEvent (subevent_code = PHY_UPDATE_COMPLETE) {
@@ -5543,7 +5543,7 @@ enum DataStatus : 2 {
  RESERVED = 0x3,
  RESERVED = 0x3,
}
}


struct LeExtendedAdvertisingReport {
struct LeExtendedAdvertisingResponse {
  connectable : 1,
  connectable : 1,
  scannable : 1,
  scannable : 1,
  directed : 1,
  directed : 1,
@@ -5566,8 +5566,8 @@ struct LeExtendedAdvertisingReport {
}
}


packet LeExtendedAdvertisingReport : LeMetaEvent (subevent_code = EXTENDED_ADVERTISING_REPORT) {
packet LeExtendedAdvertisingReport : LeMetaEvent (subevent_code = EXTENDED_ADVERTISING_REPORT) {
  _count_(advertising_reports) : 8,
  _count_(responses) : 8,
  advertising_reports : LeExtendedAdvertisingReport[],
  responses : LeExtendedAdvertisingResponse[],
}
}


packet LePeriodicAdvertisingSyncEstablished : LeMetaEvent (subevent_code = PERIODIC_ADVERTISING_SYNC_ESTABLISHED) {
packet LePeriodicAdvertisingSyncEstablished : LeMetaEvent (subevent_code = PERIODIC_ADVERTISING_SYNC_ESTABLISHED) {
+5 −5
Original line number Original line Diff line number Diff line
@@ -304,13 +304,13 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
      LOG_INFO("Dropping invalid advertising event");
      LOG_INFO("Dropping invalid advertising event");
      return;
      return;
    }
    }
    std::vector<LeAdvertisingReport> reports = event_view.GetAdvertisingReports();
    std::vector<LeAdvertisingResponse> reports = event_view.GetResponses();
    if (reports.empty()) {
    if (reports.empty()) {
      LOG_INFO("Zero results in advertising event");
      LOG_INFO("Zero results in advertising event");
      return;
      return;
    }
    }


    for (LeAdvertisingReport report : reports) {
    for (LeAdvertisingResponse report : reports) {
      uint16_t extended_event_type = 0;
      uint16_t extended_event_type = 0;
      switch (report.event_type_) {
      switch (report.event_type_) {
        case hci::AdvertisingEventType::ADV_IND:
        case hci::AdvertisingEventType::ADV_IND:
@@ -362,7 +362,7 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
      LOG_INFO("Dropping invalid advertising event");
      LOG_INFO("Dropping invalid advertising event");
      return;
      return;
    }
    }
    std::vector<LeDirectedAdvertisingReport> reports = event_view.GetAdvertisingReports();
    std::vector<LeDirectedAdvertisingResponse> reports = event_view.GetResponses();
    if (reports.empty()) {
    if (reports.empty()) {
      LOG_INFO("Zero results in advertising event");
      LOG_INFO("Zero results in advertising event");
      return;
      return;
@@ -377,13 +377,13 @@ struct LeScanningManager::impl : public bluetooth::hci::LeAddressManagerCallback
      LOG_INFO("Dropping invalid advertising event");
      LOG_INFO("Dropping invalid advertising event");
      return;
      return;
    }
    }
    std::vector<LeExtendedAdvertisingReport> reports = event_view.GetAdvertisingReports();
    std::vector<LeExtendedAdvertisingResponse> reports = event_view.GetResponses();
    if (reports.empty()) {
    if (reports.empty()) {
      LOG_INFO("Zero results in advertising event");
      LOG_INFO("Zero results in advertising event");
      return;
      return;
    }
    }


    for (LeExtendedAdvertisingReport report : reports) {
    for (LeExtendedAdvertisingResponse report : reports) {
      uint16_t event_type = report.connectable_ | (report.scannable_ << kScannableBit) |
      uint16_t event_type = report.connectable_ | (report.scannable_ << kScannableBit) |
                            (report.directed_ << kDirectedBit) | (report.scan_response_ << kScanResponseBit) |
                            (report.directed_ << kDirectedBit) | (report.scan_response_ << kScanResponseBit) |
                            (report.legacy_ << kLegacyBit) | ((uint16_t)report.data_status_ << kDataStatusBits);
                            (report.legacy_ << kLegacyBit) | ((uint16_t)report.data_status_ << kDataStatusBits);
Loading