Hi TI and All:
Our Project designed CC2640 as the BLE Central.
We expect the BLE Central could Scan and report about max to 400~500 Peripherals every time; and Scan again and again to implement the BLE Location.
Our Central code based on SimpleBLECentral.
Q1:
We modified DEFAULT_MAX_SCAN_RES from 8 to 0,
#define GAPCENTRALROLE_MAX_SCAN_RES 0x404 //!< Maximum number of discover scan results to receive. Default is 0 = unlimited.
there is no GAP_DEVICE_INFO_EVENT reported, but not unlimited in fact.
so , we try DEFAULT_MAX_SCAN_RES with 255, the CC2640 crash if there are more than 100 Peripherals.
We increased HEAPMGR_SIZE=7000. and deleted
//static gapDevRec_t devList[DEFAULT_MAX_SCAN_RES];
and deleted SimpleBLECentral_addDeviceInfo() function.
do nothing at GAP_DEVICE_INFO_EVENT and GAP_DEVICE_DISCOVERY_EVENT.
by all above, the problem still exist.
try DEFAULT_MAX_SCAN_RES to 100, it can work, but only Scan few times.
try DEFAULT_MAX_SCAN_RES to 80, it can work about half-hour.(DEFAULT_SCAN_DURATION 4000)
try DEFAULT_MAX_SCAN_RES to 50, it can work about 5 hours.
so, we doubt the HEAP memory.
i try to add counter in HEAPMGR_MALLOC() , HEAPMGR_REALLOC and HEAPMGR_FREE() of heapmgr.h
we found MALLOC times is more than FREE when do a Scan.
There is 100+ Peripherals around the Central, it looks like MALLOC 2297 times and FREE 1071 times.
SComplete, m:2297, r:0, f:1071
SComplete, m:4323, r:0, f:2064
SComplete, m:6251, r:0, f:3041
SComplete, m:8338, r:0, f:4025
...
Is there memory leak in the BLE SDK ?
How could we scan more Peripherals ?
Q2:
By BLE Core 4.1 SPEC 7.8.11 LE Set Scan Enable Command
HCI_LE_Set_Scan_Enable could set Filter_Duplicates to 0x00 Duplicate filtering disabled.
But i did not found the way from BLE SDK 2.1.
Is there a way to implement the unlimited Scan?
Thanks.
liu.tiezhu
010-58018888-71543