<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to run scanning with limited duration only in KW38 BLE in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-run-scanning-with-limited-duration-only-in-KW38-BLE/m-p/1182425#M58806</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;App_StartScanning(&amp;amp;gScanParams, BleApp_ScanningCallback, gGapDuplicateFilteringDisable_c, gGapScanContinuously_d, gGapScanPeriodicDisabled_d);&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;gapScanningParameters_t gScanParams =&lt;BR /&gt;{&lt;BR /&gt;.type = gScanTypePassive_c,&lt;BR /&gt;.interval = 3200,&lt;BR /&gt;.window = 1600,&lt;BR /&gt;.ownAddressType = gBleAddrTypePublic_c,&lt;BR /&gt;.filterPolicy = gScanAll_c,&lt;BR /&gt;.scanningPHYs = gLePhy1MFlag_c&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;That is, scan window is 1 second and interval is 2 second. It works fine.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;App_StartScanning(&amp;amp;gScanParams, BleApp_ScanningCallback, gGapDuplicateFilteringDisable_c, 100, gGapScanPeriodicDisabled_d);&lt;/P&gt;&lt;P&gt;but the scan never stops. I tried the following values: 100, 101, 200, 201, 1000, always without success.&lt;/P&gt;&lt;P&gt;Please help to make scan periodic.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 15:27:51 GMT</pubDate>
    <dc:creator>FedericoWegher</dc:creator>
    <dc:date>2020-11-12T15:27:51Z</dc:date>
    <item>
      <title>How to run scanning with limited duration only in KW38 BLE</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-run-scanning-with-limited-duration-only-in-KW38-BLE/m-p/1182425#M58806</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;App_StartScanning(&amp;amp;gScanParams, BleApp_ScanningCallback, gGapDuplicateFilteringDisable_c, gGapScanContinuously_d, gGapScanPeriodicDisabled_d);&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;gapScanningParameters_t gScanParams =&lt;BR /&gt;{&lt;BR /&gt;.type = gScanTypePassive_c,&lt;BR /&gt;.interval = 3200,&lt;BR /&gt;.window = 1600,&lt;BR /&gt;.ownAddressType = gBleAddrTypePublic_c,&lt;BR /&gt;.filterPolicy = gScanAll_c,&lt;BR /&gt;.scanningPHYs = gLePhy1MFlag_c&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;That is, scan window is 1 second and interval is 2 second. It works fine.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;App_StartScanning(&amp;amp;gScanParams, BleApp_ScanningCallback, gGapDuplicateFilteringDisable_c, 100, gGapScanPeriodicDisabled_d);&lt;/P&gt;&lt;P&gt;but the scan never stops. I tried the following values: 100, 101, 200, 201, 1000, always without success.&lt;/P&gt;&lt;P&gt;Please help to make scan periodic.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 15:27:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-run-scanning-with-limited-duration-only-in-KW38-BLE/m-p/1182425#M58806</guid>
      <dc:creator>FedericoWegher</dc:creator>
      <dc:date>2020-11-12T15:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to run scanning with limited duration only in KW38 BLE</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-run-scanning-with-limited-duration-only-in-KW38-BLE/m-p/1184002#M58835</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/29833"&gt;@FedericoWegher&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Duration and period parameters are not part of the legacy Scan Enable command. They are included only in Extended Scan Enable command.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="legacy_scan.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/130165i3157801AA0B9F445/image-size/medium?v=v2&amp;amp;px=400" role="button" title="legacy_scan.PNG" alt="legacy_scan.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="extended.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/130166i9B8F8B072341F6BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="extended.PNG" alt="extended.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In our API, they are used only when extended scanning is enabled, otherwise they are ignored.&lt;/P&gt;
&lt;P&gt;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).&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;use&amp;nbsp;lib_ble_5-0_AE_host_cm0p_iar.a instead of&amp;nbsp;lib_ble_5-0_host_cm0p_iar.a&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="lib.PNG" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/130174i7A9E6A51E857B5F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lib.PNG" alt="lib.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;add&amp;nbsp;#define gAppExtAdvEnable_d 1 in app_preinclude.h file&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need more details please let us know.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Anca&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 16:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-run-scanning-with-limited-duration-only-in-KW38-BLE/m-p/1184002#M58835</guid>
      <dc:creator>anca_codreanu</dc:creator>
      <dc:date>2020-11-16T16:36:05Z</dc:date>
    </item>
  </channel>
</rss>

