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

Commit 4eacaa68 authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge "Remove unused include/ble_advertiser.h" into main

parents ce06cd2f bfc951dc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include <base/memory/weak_ptr.h>
#include <gmock/gmock.h>

#include "ble_advertiser.h"
#include "include/hardware/ble_advertiser.h"

class MockBleAdvertisingManager : public BleAdvertiserInterface {
@@ -42,7 +41,7 @@ class MockBleAdvertisingManager : public BleAdvertiserInterface {
              (uint8_t advertiser_id, StatusCallback cb,
               AdvertiseParameters params, std::vector<uint8_t> advertise_data,
               std::vector<uint8_t> scan_response_data, int timeout_s,
               MultiAdvCb timeout_cb),
               StatusCallback timeout_cb),
              (override));
  MOCK_METHOD((void), StartAdvertisingSet,
              (uint8_t client_id, int reg_id,
+7 −5
Original line number Diff line number Diff line
@@ -27,10 +27,10 @@
#include "base/logging.h"
#include "bta/le_audio/broadcaster/broadcaster_types.h"
#include "bta/le_audio/le_audio_types.h"
#include "gd/common/strings.h"
#include "common/strings.h"
#include "hci/le_advertising_manager.h"
#include "osi/include/log.h"
#include "osi/include/properties.h"
#include "stack/include/ble_advertiser.h"
#include "stack/include/btm_iso_api.h"

using bluetooth::common::ToString;
@@ -143,11 +143,12 @@ class BroadcastStateMachineImpl : public BroadcastStateMachine {
             tx_power, status);

    /* If this callback gets called the advertising_sid is valid even though the
     * status can be other than BTM_BLE_MULTI_ADV_SUCCESS.
     * status can be other than SUCCESS.
     */
    advertising_sid_ = advertising_sid;

    if (status != BTM_BLE_MULTI_ADV_SUCCESS) {
    if (status !=
        bluetooth::hci::AdvertisingCallback::AdvertisingStatus::SUCCESS) {
      LOG_ERROR("Creating Announcement failed");
      callbacks_->OnStateMachineCreateStatus(GetBroadcastId(), false);
      return;
@@ -169,7 +170,8 @@ class BroadcastStateMachineImpl : public BroadcastStateMachine {
    LOG_INFO("operation=%s, broadcast_id=%d, status=%d",
             (enable ? "enable" : "disable"), GetBroadcastId(), status);

    if (status == BTM_BLE_MULTI_ADV_SUCCESS) {
    if (status ==
        bluetooth::hci::AdvertisingCallback::AdvertisingStatus::SUCCESS) {
      /* Periodic is enabled but without BIGInfo. Stream is suspended. */
      if (enable) {
        SetState(State::CONFIGURED);
+1 −2
Original line number Diff line number Diff line
@@ -21,11 +21,10 @@
#include <gtest/gtest.h>

#include "../le_audio_types.h"
#include "ble_advertiser.h"
#include "btm_iso_api.h"
#include "mock_ble_advertising_manager.h"
#include "mock_iso_manager.h"
#include "stack/include/ble_advertiser.h"
#include "stack/include/btm_ble_api_types.h"
#include "state_machine.h"
#include "test/common/mock_functions.h"

+1 −2
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@
#include "gd/hci/le_advertising_manager.h"
#include "main/shim/entry.h"
#include "main/shim/helpers.h"
#include "stack/include/ble_advertiser.h"
#include "stack/include/btm_log_history.h"
#include "stack/include/main_thread.h"
#include "types/raw_address.h"
@@ -123,7 +122,7 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
                        AdvertiseParameters params,
                        std::vector<uint8_t> advertise_data,
                        std::vector<uint8_t> scan_response_data, int timeout_s,
                        MultiAdvCb timeout_cb) override {
                        StatusCallback timeout_cb) override {
    LOG(INFO) << __func__ << " in shim layer";

    bluetooth::hci::AdvertisingConfig config{};
+0 −65
Original line number Diff line number Diff line
/******************************************************************************
 *
 *  Copyright 2016 The Android Open Source Project
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 ******************************************************************************/

#ifndef BLE_ADVERTISER_H
#define BLE_ADVERTISER_H

#include <base/functional/bind.h>
#include <base/memory/weak_ptr.h>

#include <cstdint>
#include <vector>

#include "btm_ble_api.h"
#include "types/raw_address.h"

#define BTM_BLE_MULTI_ADV_SUCCESS 0
#define BTM_BLE_MULTI_ADV_FAILURE 1
#define ADVERTISE_FAILED_TOO_MANY_ADVERTISERS 0x02

using MultiAdvCb = base::Callback<void(uint8_t /* status */)>;
using ParametersCb =
    base::Callback<void(uint8_t /* status */, int8_t /* tx_power */)>;

// methods we must have defined
void btm_ble_update_dmt_flag_bits(uint8_t* flag_value,
                                  const uint16_t connect_mode,
                                  const uint16_t disc_mode);

typedef struct {
  uint16_t advertising_event_properties;
  uint32_t adv_int_min;
  uint32_t adv_int_max;
  tBTM_BLE_ADV_CHNL_MAP channel_map;
  tBTM_BLE_AFP adv_filter_policy;
  int8_t tx_power;
  uint8_t primary_advertising_phy;
  uint8_t secondary_advertising_phy;
  uint8_t scan_request_notification_enable;
  uint8_t own_address_type;
} tBTM_BLE_ADV_PARAMS;

typedef struct {
  bool enable;
  bool include_adi;
  uint16_t min_interval;
  uint16_t max_interval;
  uint16_t periodic_advertising_properties;
} tBLE_PERIODIC_ADV_PARAMS;

#endif  // BLE_ADVERTISER_H