BLE: Set coding of ESP32-C3

rbrakhya
Posts: 8
Joined: Sat May 08, 2021 10:09 am

BLE: Set coding of ESP32-C3

Postby rbrakhya » Tue May 18, 2021 5:27 am

I need to make sure that i have maximised the range of the BLE, i've managed to set the mode to CODED PHY, TX_power=15, how can i see which coding is used, s=2 or s=8?
I've used these settings:

Code: Select all

 esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P18 );
 esp_ble_gap_set_prefered_default_phy(ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING,ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING);
I'm using Arduino IDE with ESP32 library
Thank you.

ramier
Posts: 8
Joined: Sat Dec 18, 2021 9:01 pm

Re: BLE: Set coding of ESP32-C3

Postby ramier » Thu Dec 28, 2023 12:03 pm

Setting

Code: Select all

ble_gap_set_prefered_default_le_phy(BLE_GAP_LE_PHY_CODED, BLE_GAP_LE_PHY_CODED);
works a bit... but for some reason 2M PHY is enabled and not Coded PHY.

Any idea why this would happen?

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: BLE: Set coding of ESP32-C3

Postby MicroController » Thu Dec 28, 2023 12:16 pm

What's the device at the other end?
With BLE, connection parameters are dynamically negotiated between the two devices, so if either of them can't/won't use the coded PHY it's not going to be used for the connection. That's why you set a preferred PHY only.

Who is online

Users browsing this forum: Baidu [Spider], ignisuti and 108 guests