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

Commit 2e17a193 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "Properly pass address type when extended advertisement is received"

parents 4a7b5faf 926175b2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ class LeScanningManagerFacadeService : public LeScanningManagerFacade::Service,
          LeReportMsg le_report_msg;
          std::vector<LeAdvertisingReport> advertisements;
          LeAdvertisingReport le_advertising_report;
          le_advertising_report.address_type_ = report->address_type_;
          le_advertising_report.address_type_ = static_cast<AddressType>(report->address_type_);
          le_advertising_report.address_ = report->address_;
          le_advertising_report.advertising_data_ = report->gap_data_;
          le_advertising_report.event_type_ = report->advertising_event_type_;
@@ -90,6 +90,7 @@ class LeScanningManagerFacadeService : public LeScanningManagerFacade::Service,
          LeReportMsg le_report_msg;
          std::vector<LeExtendedAdvertisingReport> advertisements;
          LeExtendedAdvertisingReport le_extended_advertising_report;
          le_extended_advertising_report.address_type_ = report->address_type_;
          le_extended_advertising_report.address_ = report->address_;
          le_extended_advertising_report.advertising_data_ = report->gap_data_;
          le_extended_advertising_report.rssi_ = report->rssi_;
+14 −6
Original line number Diff line number Diff line
@@ -24,15 +24,23 @@ namespace bluetooth::hci {
class LeReport {
 public:
  explicit LeReport(const LeAdvertisingReport& advertisement)
      : report_type_(ReportType::ADVERTISING_EVENT), advertising_event_type_(advertisement.event_type_),
        address_(advertisement.address_), address_type_(advertisement.address_type_), rssi_(advertisement.rssi_),
      : report_type_(ReportType::ADVERTISING_EVENT),
        advertising_event_type_(advertisement.event_type_),
        address_(advertisement.address_),
        address_type_(static_cast<DirectAdvertisingAddressType>(advertisement.address_type_)),
        rssi_(advertisement.rssi_),
        gap_data_(advertisement.advertising_data_) {}
  explicit LeReport(const LeDirectedAdvertisingReport& advertisement)
      : report_type_(ReportType::DIRECTED_ADVERTISING_EVENT), address_(advertisement.address_),
      : report_type_(ReportType::DIRECTED_ADVERTISING_EVENT),
        address_(advertisement.address_),
        address_type_(advertisement.address_type_),
        rssi_(advertisement.rssi_) {}
  explicit LeReport(const LeExtendedAdvertisingReport& advertisement)
      : report_type_(ReportType::EXTENDED_ADVERTISING_EVENT), address_(advertisement.address_),
        rssi_(advertisement.rssi_), gap_data_(advertisement.advertising_data_) {}
      : report_type_(ReportType::EXTENDED_ADVERTISING_EVENT),
        address_(advertisement.address_),
        address_type_(advertisement.address_type_),
        rssi_(advertisement.rssi_),
        gap_data_(advertisement.advertising_data_) {}
  virtual ~LeReport() = default;

  enum class ReportType {
@@ -49,7 +57,7 @@ class LeReport {
  // Advertising Event
  const AdvertisingEventType advertising_event_type_{};
  const Address address_{};
  const AddressType address_type_{};
  const DirectAdvertisingAddressType address_type_{};
  const int8_t rssi_;
  const std::vector<GapData> gap_data_{};
};