nRF51822和nRF52832 广播功率设置

本文介绍了如何在nRF51822(SDK12.3.0)和nRF52832(SDK15.0.0)上设置广播包的传输功率。在nRF51822中,使用sd_ble_gap_tx_power_set函数设置-30到4 dBm的功率。而在nRF52832中,除了相同的功率级别外,还需要指定角色(如广播、扫描/发起者、连接)和句柄,并确保在开启广播后设置功率。
摘要由CSDN通过智能技术生成

1、nRF51822 广播包的设置(SDK12.3.0):

/**@brief Set the radio's transmit power.
 *
 * @param[in] tx_power Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm).
 *
 * @note The -30dBm setting is only available on nRF51 series ICs.
 * @note The -40dBm setting is only available on nRF52 series ICs.
 *
 * @retval ::NRF_SUCCESS Successfully changed the transmit power.
 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
 */
SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(int8_t tx_power));

1.1、在需要设置的地方加上sd_ble_gap_tx_power_set(int8_t tx_power); tx_power形参的值分别:-30, -20, -16, -12, -8, -4, 0, and 4 dBm,值越大信号越强。

2、nRF52832 广播包的设置(SDK15.0.0):

/**@brief Set the radio's transmit power.
 *
 * @param[in] role The role to s

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值