Other Parts Discussed in Thread: CC2650, , BLE-STACK, CC2540
I have a similar issue as described in this thread. The numbers are also the same, although I find my scanning stops at anywhere between 20-27 devices reported.
I have built versions as Central and Peripheral/Observers and observe the same behaviour.
// Scan duration in ms
#define DEFAULT_SCAN_DURATION 0
With the scan period set to zero the scan should just continue, this in essence seems to be the case as I never get back GAP_DEVICE_DISCOVERY_EVENT to say that the scanning is complete.
The GAPCENTRALROLE_MAX_SCAN_RES parameter is set to 255 as setting this to 0 seems to stop ANY advertisements being received at all despite some documentation suggesting otherwise (i note in the central role it is clearly stated it will stop receiving). I also noted that in the examples the setting DEFAULT_MAX_SCAN_RES is used to set the GAPCENTRALROLE_MAX_SCAN_RES parameter and to create application storage for the returned data.
I have the TGAP_FILTER_ADV_REPORTS parameter set to FALSE and I am receiving packets via GAP_DEVICE_INFO_EVENT, as the beacon I am looking for may have variable data. Even with the processing code cut to the bear minimum (no display no serial, no filters) so as not to slow the process (although this is a priority one thread waiting on ICall_wait) the problem still exists. When a number of devices have been reported 20-27 in my tests the ICall_wait fails to return. The system has not stopped and seems to still be operating if I then make a GAP_DeviceDiscoveryCancel(selfEntity) call when in this "stopped" state, the scanning is halted and the the subsequent GAP_DEVICE_DISCOVERY_EVENT is received. Restarting the scanning allows a further 20-27 devices to be received before the system stops receiving.
I have found the same operation in peripheral/observer and central roles, I have even reverted back to building the shipped examples with the smallest of tweaks and running them on the TI dev board. the results are the same. In very busy BT environments this means that scanning is halted very quickly. I have confirmed operation with low numbers for DEFAULT_MAX_SCAN_RES and can confirm when the max number is reached the scanning stops in exactly the same way, ICall_wait simply stops reporting any events as expected. As I can tell from the application variables this point is reached I could restart scanning, but in busy environments reducing the DEFAULT_MAX_SCAN_RES is not an option for our application.
As this is being observed in products already deployed it would be good to find a solution that allows the expected operation to work. Our expectation would be to set the parameters as described above and when the buffer fills to restart scanning, with the GAPCENTRALROLE_MAX_SCAN_RES parameter set to 255, this still means a high number of stops and restarts in a busy environment but we feel it would solve our problem. Ideally when setting GAPCENTRALROLE_MAX_SCAN_RES to 0 this should not store any packets (as suggested in some documentation) for the GAP_DEVICE_DISCOVERY_EVENT and rely solely on gathering the interesting packets from the GAP_DEVICE_INFO_EVENT.
From reading the referenced thread it would seem that this situation would not be improved by using the cc2640r2 or the 5.1 stack.
Any help to resolve this issue would be appreciated.