@@ -207,6 +207,7 @@ void BLEScan::clearResults() {
207
207
#if defined(CONFIG_BLUEDROID_ENABLED)
208
208
209
209
#if defined(SOC_BLE_50_SUPPORTED)
210
+
210
211
void BLEScan::setExtendedScanCallback (BLEExtAdvertisingCallbacks *cb) {
211
212
m_pExtendedScanCb = cb;
212
213
}
@@ -241,6 +242,48 @@ void BLEScan::setPeriodicScanCallback(BLEPeriodicScanCallbacks *cb) {
241
242
m_pPeriodicScanCb = cb;
242
243
}
243
244
245
+ /* *
246
+ * @brief This function is used to set the extended scan parameters to be used on the advertising channels.
247
+ *
248
+ *
249
+ * @return - ESP_OK : success
250
+ * - other : failed
251
+ *
252
+ */
253
+ esp_err_t BLEScan::setExtScanParams () {
254
+ esp_ble_ext_scan_params_t ext_scan_params = {
255
+ .own_addr_type = BLE_ADDR_TYPE_PUBLIC,
256
+ .filter_policy = BLE_SCAN_FILTER_ALLOW_ALL,
257
+ .scan_duplicate = BLE_SCAN_DUPLICATE_DISABLE,
258
+ .cfg_mask = ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK | ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK,
259
+ .uncoded_cfg = {BLE_SCAN_TYPE_ACTIVE, 40 , 40 },
260
+ .coded_cfg = {BLE_SCAN_TYPE_ACTIVE, 40 , 40 },
261
+ };
262
+
263
+ esp_err_t rc = esp_ble_gap_set_ext_scan_params (&ext_scan_params);
264
+ if (rc) {
265
+ log_e (" set extend scan params error, error code = %x" , rc);
266
+ }
267
+ return rc;
268
+ }
269
+
270
+ /* *
271
+ * @brief This function is used to set the extended scan parameters to be used on the advertising channels.
272
+ *
273
+ * @param[in] params : scan parameters
274
+ *
275
+ * @return - ESP_OK : success
276
+ * - other : failed
277
+ *
278
+ */
279
+ esp_err_t BLEScan::setExtScanParams (esp_ble_ext_scan_params_t *ext_scan_params) {
280
+ esp_err_t rc = esp_ble_gap_set_ext_scan_params (ext_scan_params);
281
+ if (rc) {
282
+ log_e (" set extend scan params error, error code = %x" , rc);
283
+ }
284
+ return rc;
285
+ }
286
+
244
287
#endif // SOC_BLE_50_SUPPORTED
245
288
246
289
/* *
0 commit comments