Page 1 of 1

BLE: Set coding of ESP32-C3

Posted: Tue May 18, 2021 5:27 am
by rbrakhya
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.

Re: BLE: Set coding of ESP32-C3

Posted: Thu Dec 28, 2023 12:03 pm
by ramier
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?

Re: BLE: Set coding of ESP32-C3

Posted: Thu Dec 28, 2023 12:16 pm
by MicroController
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.