How to configure QN908x for the continuous SCAN mode? And to scan more than ten devices.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure QN908x for the continuous SCAN mode? And to scan more than ten devices.

999 Views
kishansaralaya
Contributor III

How to configure QN908x for the continuous SCAN mode? And to scan more than ten devices.


We tried to test this feature [always scan mode] using Wireless UART (freertos version) example code - where we commented out the case logic defined for gScanStateChanged_c - this will stop triggering the ScanningTimerCallback method and this method calls GAPStop().  And then tried to set different values to "gGapScanContinuously_d" passed in the gGapCentral_c case of the BleApp_Start() . Irrespective of any of these changes is unable to keep the QN908x in the continuous SCAN mode and also the other issue is here QN908x is able to scan only 10 BLE Peripheral devices present in the vicinity. 

Is there any configurations needs to be made in order to scan more than ten devices ?. [we configured the scan parameter to gPairingParameters.localIoCapabilities = gIoNone_c]. In our test environment there were more than 15 BLE peripheral devices and able to see them using other BLE Test tools but NXP QN908x controller is able to list only any of the 10 from these 15]

Labels (1)
  • QN

8 Replies

816 Views
kishansaralaya
Contributor III

Thank you Sebastian for your input

816 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Kishan, I hope you're doing well!

 

Could you please let me know how are you getting the number of scanned devices?

 

I tried using the FSCI SDK example with a scan command and was able to scan more than 10 devices without issue.

 

Are you seeing a scan request and response for each of the 10 devices using a BLE Sniffer?

 

Best regards,

Sebastian

0 Kudos

816 Views
kishansaralaya
Contributor III

Hi Sebastian,

 Thank you for your reply. 

 Am counting the number of discovered devices in the gDeviceScanned_c event call. For your reference below is the src code of this event method. Let me know if am missing anything here.

static 

static void BleApp_ScanningCallback(gapScanningEvent_t *pScanningEvent)
{

switch (pScanningEvent->eventType)
{
case gDeviceScanned_c:
{

(void)Serial_Print(gAppSerMgrIf, "\n\rAddress: ",1);

Serial_PrintDec( gAppSerMgrIf, count );
count++;
(void)Serial_Print(gAppSerMgrIf, " ",1);
Serial_PrintHex( gAppSerMgrIf,
pScanningEvent->eventData.scannedDevice.aAddress,6, 1);
(void)Serial_Print(gAppSerMgrIf, "\r\n ",1);

}
break;

----

}

0 Kudos

816 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Kishan,

 

Could you please take a look at the BLE Shell SDK example?

 

It has a scanning command: "gap scanstart", this command scans the advertising devices around the QN9080 and displays information about them on a serial terminal (connected via UART to the QN9080:

pastedImage_1.png

The "ShellGap_StartScanning" shows an example on how to enable scanning for all of the available devices, could you please take a look at it? (it's found in the shell_gap.c source file).

 

The corresponding device information is printed in the ShellGap_ScanningCallback function, in the same source file as the previous function.

 

This example can be found in the following path:

<…\SDK_2.2.1_QN908XCDK\boards\qn908xcdk\wireless_examples\bluetooth\ble_shell>

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

 

 

 

0 Kudos

816 Views
kishansaralaya
Contributor III

Thank you sebastian for the update,

BLE Shell example code scans for a peripheral in a one go, I do not see BLE scanning operation taking place after the defined configure scan window time.  
In "Gap_StartScanning()"  configured  mScanDuration, mScanPeriod parameters and also configured "enableFilterDuplicates = gGapDuplicateFilteringEnable_c"

After these changes whenever I run the "gap scanstart" command output will be listing only 10 devices and it does not scan for the new devices.BLE_Shell_Scan_Window.png

Best Regards,

 Kishan

0 Kudos

816 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Kishan,

 

By default, the BLE shell application (as well as some of the other demo applications) is configured to continuously scan for advertising devices until scanning is disabled.

If the value for the scanning window is changed from 0 to any other value, then the scanning will take place only for the time it was configured for.

 

If you leave the value on 0, could you please check to see if you can scan more than 10 devices?

 

Please let me know if you continue to have issues.

 

Best regards,

Sebastian

0 Kudos

816 Views
kishansaralaya
Contributor III

Hi Sebastian,

  Figured out the reason for scan get stopped after finding 10th BLE device, the reason for this is the configuration value set for   enableFilterDuplicates = gGapDuplicateFilteringEnable_c , If we disable DuplicateFiltering controller scans for the peripherals in a continuous mode. 

Thank you,

  Kishan

0 Kudos

816 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Kishan,

Please let me know if you have any further issues.

Best regards,

Sebastian