Chapter 4. Software framework
4.1.60 When using ESP32-C3 BLE Scan, can I set it to only scan the Long Range devices?
• Yes, you can make tests based on esp-idf/examples/bluetooth/bluedroid/ble_50/ble50_security_client.
By changing the conguration .cfg_mask = ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK
| ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK
in
ext_scan_params to .cfg_mask =
ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK, you can scan the broadcast packets whose primary
PHY type is LE CODED PHY.
4.1.61 Is there a limit to the name length of ESP32 as a Bluetooth device?
• The names should be no longer than 248 bytes. However, in practice, the name length is also limited by
the length of Bluetooth advertising packets. For the description of congurations, please refer to CON-
FIG_BT_MAX_DEVICE_NAME_LEN.
4.1.62 How do I set the ESP32 BLE Scan to the permanent scan without generating a
timeout?
• You can realize this by setting“duration”to 0 before using the esp_ble_gap_start_scanning() function to start
BLE Scan.
4.1.63 How can I get RSSI of BLE devices through ESP32?
• You can use the esp_ble_gap_read_rssi() function to get RSSI of connected BLE devices.
• If you want to get RSSI of all scanned BLE devices around, please use the ble_scan_result_evt_param structure
in the ESP_GAP_BLE_SCAN_RESULT_EVT event to enable the printing of RSSI.
4.1.64 How can I increase the transmission distance of BLE5.0? How can I set BLE5.0
to long-range mode?
• In practice, the transmission distance of BLE5.0 is about 200 m. It is recommended to refer to the actual test
distance. ESP32-S3 supports the features of BLE5.0, and supports long-range communication through Coded
PHY (125 Kbps and 500 Kbps) and broadcast extension.
• You can realize long-range communication by using 125 Kbps Coded PHY and increasing the transmit power
(tx_power). Refer to the following settings:
esp_ble_gap_ext_adv_params_t ext_adv_params_coded = {
.type = ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE,
.interval_min = 0x50,
.interval_max = 0x50,
.channel_map = ADV_CHNL_ALL,
.filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY,
.primary_phy = ESP_BLE_GAP_PHY_CODED,
.max_skip = 0,
.secondary_phy = ESP_BLE_GAP_PHY_CODED,
.sid = 0,
.scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
.tx_power = 18,
};
Espressif Systems 55
Submit Document Feedback
Release master