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

Commit e7fee400 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Turn channel map for advertising into property

Some radio folks would like this for their tests

Tag: #feature
Test: set property for tests
Change-Id: Ie6214724aee843e7b1776ec03acd24945df4572d
parent f84524e6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "btif_common.h"
#include "main/shim/le_advertising_manager.h"
#include "main/shim/shim.h"
#include "osi/include/properties.h"
#include "stack/include/btu.h"

using base::Bind;
@@ -64,10 +65,14 @@ static inline OwnedArrayWrapper<T> OwnedArray(T* o) {

void parseParams(tBTM_BLE_ADV_PARAMS* p_params,
                 const AdvertiseParameters& params) {
  // By default use all channels, but have property for tweaking.
  int channel_map = osi_property_get_int32(
      "persist.bluetooth.advertising_channel_map", params.channel_map);

  p_params->advertising_event_properties = params.advertising_event_properties;
  p_params->adv_int_min = params.min_interval;
  p_params->adv_int_max = params.max_interval;
  p_params->channel_map = params.channel_map;
  p_params->channel_map = channel_map;
  p_params->adv_filter_policy = 0;
  p_params->tx_power = params.tx_power;
  p_params->primary_advertising_phy = params.primary_advertising_phy;