日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

NRF51822之发射功率

發(fā)布時(shí)間:2025/3/21 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 NRF51822之发射功率 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

設(shè)置藍(lán)牙的TX Power

?

使用的函數(shù)sd_ble_gap_tx_power_set(int8_t tx_power);

?

參看例子為 S110/ble_app_proximity

#define TX_POWER_LEVEL (4) /**< TX Power Level value. This will be set both in the TX Power service, in the advertising data, and also used to set the radio transmit power. */

?

?

static void gap_params_init(void) {uint32_t err_code;ble_gap_conn_params_t gap_conn_params;ble_gap_conn_sec_mode_t sec_mode;BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)DEVICE_NAME, strlen(DEVICE_NAME));APP_ERROR_CHECK(err_code);err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_KEYRING);APP_ERROR_CHECK(err_code);memset(&gap_conn_params, 0, sizeof(gap_conn_params));gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;gap_conn_params.slave_latency = SLAVE_LATENCY;gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;err_code = sd_ble_gap_ppcp_set(&gap_conn_params);APP_ERROR_CHECK(err_code);err_code = sd_ble_gap_tx_power_set(TX_POWER_LEVEL);APP_ERROR_CHECK(err_code); }

?

可以設(shè)置的輸出的功率為 accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm

/**@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 -40 dBm will not actually give -40 dBm, but will instead be remapped to -30 dBm. * * @return @ref NRF_SUCCESS Successfully changed the transmit power. * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. * @return @ref NRF_ERROR_BUSY The stack is busy, process pending events and retry. */ SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(int8_t tx_power));

總結(jié)

以上是生活随笔為你收集整理的NRF51822之发射功率的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。