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

Commit 51774111 authored by Ed Heyl's avatar Ed Heyl
Browse files

Fix builds: Revert "Added code to publish ble adv tx power in dBm"

This reverts commit f18e904a.

Change-Id: If62571a3f5bd87d04e5643855c9fea1b8048aa5a
parent f18e904a
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -53,28 +53,6 @@ void bte_load_conf(const char *path) {
  config_free(config);
}

extern int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1];
void bte_load_ble_conf(const char* path)
{
  assert(path != NULL);

  ALOGI("%s attempt to load ble stack conf from %s", __func__, path);

  config_t *config = config_new(path);
  if (!config) {
    ALOGI("%s file >%s< not found", __func__, path);
    return;
  }

  const char* ble_adv_tx_power = config_get_string(config, CONFIG_DEFAULT_SECTION, "BLE_ADV_TX_POWER", "");
  if(*ble_adv_tx_power) {
    sscanf(ble_adv_tx_power, "%d,%d,%d,%d,%d", btm_ble_tx_power, btm_ble_tx_power + 1, btm_ble_tx_power + 2,
                                               btm_ble_tx_power + 3, btm_ble_tx_power + 4);
    ALOGI("loaded btm_ble_tx_power: %d, %d, %d, %d, %d", (char)btm_ble_tx_power[0], (char)btm_ble_tx_power[1],
                                        btm_ble_tx_power[2], btm_ble_tx_power[3], btm_ble_tx_power[4]);
  }
  config_free(config);
}
// Parses the specified Device ID configuration file and registers the
// Device ID records with SDP.
void bte_load_did_conf(const char *p_path) {
@@ -129,4 +107,3 @@ void bte_load_did_conf(const char *p_path) {

    config_free(config);
}
+0 −6
Original line number Diff line number Diff line
@@ -46,10 +46,6 @@
#ifndef BTE_STACK_CONF_FILE
#define BTE_STACK_CONF_FILE "/etc/bluetooth/bt_stack.conf"
#endif
/* Run-time configuration file for BLE*/
#ifndef BTE_BLE_STACK_CONF_FILE
#define BTE_BLE_STACK_CONF_FILE "/etc/bluetooth/ble_stack.conf"
#endif

/* if not specified in .txt file then use this as default  */
#ifndef HCI_LOGGING_FILENAME
@@ -111,7 +107,6 @@ BT_API extern void BTE_LoadStack(void);
BT_API void BTE_UnloadStack(void);
extern void scru_flip_bda (BD_ADDR dst, const BD_ADDR src);
extern void bte_load_conf(const char *p_path);
extern void bte_load_ble_conf(const char *p_path);
extern bt_bdaddr_t btif_local_bd_addr;


@@ -163,7 +158,6 @@ void bte_main_boot_entry(void)
    bte_main_in_hw_init();

    bte_load_conf(BTE_STACK_CONF_FILE);
    bte_load_ble_conf(BTE_BLE_STACK_CONF_FILE);

#if (BTTRC_INCLUDED == TRUE)
    /* Initialize trace feature */
+2 −19
Original line number Diff line number Diff line
@@ -222,24 +222,7 @@ tBTM_STATUS btm_ble_enable_multi_adv (BOOLEAN enable, UINT8 inst_id, UINT8 cb_ev
    }
    return rt;
}
/*******************************************************************************
**
** Function         btm_ble_map_adv_tx_power
**
** Description      return the actual power in dBm based on the mapping in config file
**
** Parameters       advertise parameters used for this instance.
**
** Returns          tx power in dBm
**
*******************************************************************************/
int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1] = BTM_BLE_ADV_TX_POWER;
static char btm_ble_map_adv_tx_power(int tx_power_index)
{
    if(0 <= tx_power_index && tx_power_index < BTM_BLE_ADV_TX_POWER_MAX)
        return (char)btm_ble_tx_power[tx_power_index];
    return 0;
}

/*******************************************************************************
**
** Function         btm_ble_multi_adv_set_params
@@ -299,7 +282,7 @@ tBTM_STATUS btm_ble_multi_adv_set_params (tBTM_BLE_MULTI_ADV_INST *p_inst,

    if (p_params->tx_power > BTM_BLE_ADV_TX_POWER_MAX)
        p_params->tx_power = BTM_BLE_ADV_TX_POWER_MAX;
    UINT8_TO_STREAM (pp, btm_ble_map_adv_tx_power(p_params->tx_power));
    UINT8_TO_STREAM (pp, p_params->tx_power);

    BTM_TRACE_EVENT("set_params:Chnl Map %d,adv_fltr policy %d,ID:%d, TX Power%d",
        p_params->channel_map,p_params->adv_filter_policy,p_inst->inst_id,p_params->tx_power);
+0 −2
Original line number Diff line number Diff line
@@ -323,8 +323,6 @@ typedef UINT8 tBTM_BLE_AD_TYPE;
#define BTM_BLE_ADV_TX_POWER_MAX        4           /* maximum tx power */
typedef UINT8 tBTM_BLE_ADV_TX_POWER;

/* adv tx power in dBm */
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}

typedef struct
{