nimble/ll: Unify PHY tx power API names

Consistently use tx_power for transmit power related PHY API.
This commit is contained in:
Szymon Janc
2022-10-03 15:22:29 +02:00
parent 98feaf20ad
commit 8f0ecadecc
10 changed files with 32 additions and 30 deletions
@@ -111,13 +111,13 @@ int ble_phy_tx(ble_phy_tx_pducb_t pducb, void *pducb_arg, uint8_t end_trans);
void ble_phy_rxpdu_copy(uint8_t *dptr, struct os_mbuf *rxpdu);
/* Set the transmit power */
int ble_phy_txpwr_set(int dbm);
int ble_phy_tx_power_set(int dbm);
/* Get highest allowed power from range */
int ble_phy_txpower_round(int dbm);
int ble_phy_tx_power_round(int dbm);
/* Get the transmit power */
int ble_phy_txpwr_get(void);
int ble_phy_tx_power_get(void);
/* Disable the PHY */
void ble_phy_disable(void);
+4 -4
View File
@@ -1350,8 +1350,8 @@ ble_ll_task(void *arg)
ble_phy_init();
/* Set output power to default */
g_ble_ll_tx_power = ble_phy_txpower_round(MYNEWT_VAL(BLE_LL_TX_PWR_DBM));
ble_phy_txpwr_set(g_ble_ll_tx_power);
g_ble_ll_tx_power = ble_phy_tx_power_round(MYNEWT_VAL(BLE_LL_TX_PWR_DBM));
ble_phy_tx_power_set(g_ble_ll_tx_power);
/* Tell the host that we are ready to receive packets */
ble_ll_hci_send_noop();
@@ -1597,8 +1597,8 @@ ble_ll_reset(void)
g_ble_ll_rx_power_compensation = 0;
/* Set output power to default */
g_ble_ll_tx_power = ble_phy_txpower_round(MYNEWT_VAL(BLE_LL_TX_PWR_DBM));
ble_phy_txpwr_set(g_ble_ll_tx_power);
g_ble_ll_tx_power = ble_phy_tx_power_round(MYNEWT_VAL(BLE_LL_TX_PWR_DBM));
ble_phy_tx_power_set(g_ble_ll_tx_power);
/* FLush all packets from Link layer queues */
ble_ll_flush_pkt_queue(&g_ble_ll_data.ll_tx_pkt_q);
+7 -7
View File
@@ -1030,7 +1030,7 @@ ble_ll_adv_tx_done(void *arg)
struct ble_ll_adv_sm *advsm;
/* reset power to max after advertising */
ble_phy_txpwr_set(g_ble_ll_tx_power);
ble_phy_tx_power_set(g_ble_ll_tx_power);
advsm = (struct ble_ll_adv_sm *)arg;
@@ -1111,7 +1111,7 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
}
/* Set the power */
ble_phy_txpwr_set(advsm->adv_txpwr);
ble_phy_tx_power_set(advsm->adv_txpwr);
/* Set channel */
rc = ble_phy_setchan(advsm->adv_chan, BLE_ACCESS_ADDR_ADV, BLE_LL_CRCINIT_ADV);
@@ -1255,7 +1255,7 @@ ble_ll_adv_secondary_tx_start_cb(struct ble_ll_sched_item *sch)
ble_ll_adv_active_chanset_set_sec(advsm);
/* Set the power */
ble_phy_txpwr_set(advsm->adv_txpwr);
ble_phy_tx_power_set(advsm->adv_txpwr);
/* Set channel */
aux = AUX_CURRENT(advsm);
@@ -1740,7 +1740,7 @@ ble_ll_adv_halt(void)
ble_ll_trace_u32(BLE_LL_TRACE_ID_ADV_HALT, advsm->adv_instance);
ble_phy_txpwr_set(g_ble_ll_tx_power);
ble_phy_tx_power_set(g_ble_ll_tx_power);
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV)
if (advsm->flags & BLE_LL_ADV_SM_FLAG_PERIODIC_SYNC_SENDING) {
@@ -2176,7 +2176,7 @@ static void
ble_ll_adv_sync_tx_done(struct ble_ll_adv_sm *advsm)
{
/* reset power to default after advertising */
ble_phy_txpwr_set(g_ble_ll_tx_power);
ble_phy_tx_power_set(g_ble_ll_tx_power);
/* for sync we trace a no pri nor sec set */
ble_ll_trace_u32x2(BLE_LL_TRACE_ID_ADV_TXDONE, advsm->adv_instance, 0);
@@ -2232,7 +2232,7 @@ ble_ll_adv_sync_tx_start_cb(struct ble_ll_sched_item *sch)
ble_ll_adv_flags_set(advsm, BLE_LL_ADV_SM_FLAG_PERIODIC_SYNC_SENDING);
/* Set the power */
ble_phy_txpwr_set(advsm->adv_txpwr);
ble_phy_tx_power_set(advsm->adv_txpwr);
/* Set channel */
sync = SYNC_CURRENT(advsm);
@@ -3528,7 +3528,7 @@ ble_ll_adv_ext_set_param(const uint8_t *cmdbuf, uint8_t len,
/* no preference */
advsm->adv_txpwr = g_ble_ll_tx_power;
} else {
advsm->adv_txpwr = ble_phy_txpower_round(cmd->tx_power);
advsm->adv_txpwr = ble_phy_tx_power_round(cmd->tx_power);
}
/* we can always store as those are validated and used only when needed */
+1 -1
View File
@@ -243,7 +243,7 @@ ble_ll_dtm_tx_sched_cb(struct ble_ll_sched_item *sch)
ble_phy_mode_set(ctx->phy_mode, ctx->phy_mode);
#endif
ble_phy_set_txend_cb(ble_ll_dtm_tx_done, ctx);
ble_phy_txpwr_set(0);
ble_phy_tx_power_set(0);
sch->start_time += g_ble_ll_sched_offset_ticks;
+2 -2
View File
@@ -786,8 +786,8 @@ ble_ll_read_tx_power(uint8_t *rspbuf, uint8_t *rsplen)
{
struct ble_hci_le_rd_transmit_power_rp *rsp = (void *) rspbuf;
rsp->min_tx_power = ble_phy_txpower_round(-127);
rsp->max_tx_power = ble_phy_txpower_round(126);
rsp->min_tx_power = ble_phy_tx_power_round(-127);
rsp->max_tx_power = ble_phy_tx_power_round(126);
*rsplen = sizeof(*rsp);
return BLE_ERR_SUCCESS;
+2 -2
View File
@@ -126,10 +126,10 @@ ble_ll_hci_vs_set_tx_power(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
/* restore reset default */
g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
} else {
g_ble_ll_tx_power = ble_phy_txpower_round(cmd->tx_power);
g_ble_ll_tx_power = ble_phy_tx_power_round(cmd->tx_power);
}
ble_phy_txpwr_set(g_ble_ll_tx_power);
ble_phy_tx_power_set(g_ble_ll_tx_power);
rsp->tx_power = g_ble_ll_tx_power;
*rsplen = sizeof(*rsp);
+2 -2
View File
@@ -1652,7 +1652,7 @@ ble_phy_encrypt_disable(void)
#endif
int
ble_phy_txpwr_set(int dbm)
ble_phy_tx_power_set(int dbm)
{
#if MYNEWT_VAL(CMAC_DEBUG_DATA_ENABLE)
if (g_cmac_shared_data.debug.tx_power_override != INT8_MAX) {
@@ -1668,7 +1668,7 @@ ble_phy_txpwr_set(int dbm)
}
int
ble_phy_txpower_round(int dbm)
ble_phy_tx_power_round(int dbm)
{
return 0;
}
+4 -3
View File
@@ -464,7 +464,7 @@ ble_phy_tx(ble_phy_tx_pducb_t pducb, void *pducb_arg, uint8_t end_trans)
* @return int 0: success; anything else is an error
*/
int
ble_phy_txpwr_set(int dbm)
ble_phy_tx_power_set(int dbm)
{
/* Check valid range */
assert(dbm <= BLE_PHY_MAX_PWR_DBM);
@@ -492,7 +492,8 @@ ble_phy_txpwr_set(int dbm)
*
* @return int Rounded power in dBm
*/
int ble_phy_txpower_round(int dbm)
int
ble_phy_tx_power_round(int dbm)
{
/* "Rail" power level if outside supported range */
if (dbm > BLE_XCVR_TX_PWR_MAX_DBM) {
@@ -514,7 +515,7 @@ int ble_phy_txpower_round(int dbm)
* @return int The current PHY transmit power, in dBm
*/
int
ble_phy_txpwr_get(void)
ble_phy_tx_power_get(void)
{
return g_ble_phy_data.phy_txpwr_dbm;
}
+4 -3
View File
@@ -1258,7 +1258,7 @@ ble_phy_tx(ble_phy_tx_pducb_t pducb, void *pducb_arg, uint8_t end_trans)
* @return int 0: success; anything else is an error
*/
int
ble_phy_txpwr_set(int dbm)
ble_phy_tx_power_set(int dbm)
{
/* Check valid range */
assert(dbm <= BLE_PHY_MAX_PWR_DBM);
@@ -1287,7 +1287,8 @@ ble_phy_txpwr_set(int dbm)
*
* @return int Rounded power in dBm
*/
int ble_phy_txpower_round(int dbm)
int
ble_phy_tx_power_round(int dbm)
{
/* "Rail" power level if outside supported range */
if (dbm > NRF_TX_PWR_MAX_DBM) {
@@ -1309,7 +1310,7 @@ int ble_phy_txpower_round(int dbm)
* @return int The current PHY transmit power, in dBm
*/
int
ble_phy_txpwr_get(void)
ble_phy_tx_power_get(void)
{
return g_ble_phy_data.phy_txpwr_dbm;
}
+3 -3
View File
@@ -1926,7 +1926,7 @@ ble_phy_tx(ble_phy_tx_pducb_t pducb, void *pducb_arg, uint8_t end_trans)
* @return int 0: success; anything else is an error
*/
int
ble_phy_txpwr_set(int dbm)
ble_phy_tx_power_set(int dbm)
{
/* Get actual TX power supported by radio */
dbm = phy_txpower_round(dbm);
@@ -1947,7 +1947,7 @@ ble_phy_txpwr_set(int dbm)
* @return int Rounded power in dBm
*/
int
ble_phy_txpower_round(int dbm)
ble_phy_tx_power_round(int dbm)
{
return phy_txpower_round(dbm);
}
@@ -1995,7 +1995,7 @@ ble_phy_set_access_addr(uint32_t access_addr)
* @return int The current PHY transmit power, in dBm
*/
int
ble_phy_txpwr_get(void)
ble_phy_tx_power_get(void)
{
return g_ble_phy_data.phy_txpwr_dbm;
}