Hello.
I am using KW38 BLE with SDK 2.6.6 on both central and peripheral devices. Currently the central is using continuous scan, that is, is calls the following API:
App_StartScanning(&gScanParams, BleApp_ScanningCallback, gGapDuplicateFilteringDisable_c, gGapScanContinuously_d, gGapScanPeriodicDisabled_d);
with
gapScanningParameters_t gScanParams =
{
.type = gScanTypePassive_c,
.interval = 3200,
.window = 1600,
.ownAddressType = gBleAddrTypePublic_c,
.filterPolicy = gScanAll_c,
.scanningPHYs = gLePhy1MFlag_c
};
That is, scan window is 1 second and interval is 2 second. It works fine.
Now my need is to use finite duration for scanning and have it stopped after one period. Ideally, I would like to stop after the scan window is over. I modified the API call this way:
App_StartScanning(&gScanParams, BleApp_ScanningCallback, gGapDuplicateFilteringDisable_c, 100, gGapScanPeriodicDisabled_d);
but the scan never stops. I tried the following values: 100, 101, 200, 201, 1000, always without success.
Please help to make scan periodic.
Solved! Go to Solution.
Hi @FedericoWegher ,
Duration and period parameters are not part of the legacy Scan Enable command. They are included only in Extended Scan Enable command.
In our API, they are used only when extended scanning is enabled, otherwise they are ignored.
The support for Bluetooth 5.0 Extended Advertising/Scanning comes in separate host libraries in our SDK. The Bluetooth LE examples from our SDK use the legacy host libraries. To support the extended advertising/scanning, the corresponding host libraries need to be used ( they have _AE_ in their name).
Taking as example the project w_uart from the SDK ( it can be found at the following path sdk_folder\boards\frdmkw38\wireless_examples\bluetooth ), to enable the extended scanning please do the following steps:
If you need more details please let us know.
Best regards,
Anca
Hi @FedericoWegher ,
Duration and period parameters are not part of the legacy Scan Enable command. They are included only in Extended Scan Enable command.
In our API, they are used only when extended scanning is enabled, otherwise they are ignored.
The support for Bluetooth 5.0 Extended Advertising/Scanning comes in separate host libraries in our SDK. The Bluetooth LE examples from our SDK use the legacy host libraries. To support the extended advertising/scanning, the corresponding host libraries need to be used ( they have _AE_ in their name).
Taking as example the project w_uart from the SDK ( it can be found at the following path sdk_folder\boards\frdmkw38\wireless_examples\bluetooth ), to enable the extended scanning please do the following steps:
If you need more details please let us know.
Best regards,
Anca