Hi,
I have a system with around 20~40 broadcasters (2540) and one observer (2541). Each broadcaster sends unicast advertisement data every 2 sec. Observer just listens to that. The design purpose is to detect all the advertisement data from the broadcaster as fast as possible, and should not miss any one. But I found even with one broadcaster, observer can't detect broadcaster occasionally. I do not know there way to improve that.
Here is what I found in test,
- setup: observer and broadcaster is around 3 feet away and stationary. Not sure of interference, but should be low here with no other BLE device, but there is a 2G wifi router. (I did not check inside shield box)
- with 1 broadcaster in system, the detect probability is only 86%. RSSI is quite strong. I increase the scan duration on observer and there is some improvement but can't achieve 100%. I guess if I increase to long enough like 10 sec, the result will be good enough. But I want to keep it as short as possible. This means occasionally the beacon is not detected.
- with 13 broadcaster in system, there is a performance degradation, detect ratio drop from 86% to 81%.
Here is my setting:
On broadcaster, advertData is just 15 bytes.
uint8 advType = GAP_ADTYPE_ADV_NONCONN_IND; // use non-connectable advertisements
// Set the GAP Role Parameters
GAPRole_SetParameter( GAPROLE_SCAN_RSP_DATA, sizeof ( scanRspData ), scanRspData );
GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertData ), advertData );
GAPRole_SetParameter( GAPROLE_ADV_EVENT_TYPE, sizeof( uint8 ), &advType );
}
// Set advertising interval
{
uint16 advInt = 3200; //2 sec
GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MIN, advInt );
GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MAX, advInt );
GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MIN, advInt );
GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MAX, advInt );
}
#if defined( CC2540_MINIDK )
// Register for all key events - This app will handle
On observer,
SimpleBLERObserver_init(){
...
// Setup Observer Profile
uint8 scanRes = 50;
GAPObserverRole_SetParameter ( GAPOBSERVERROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes
// Setup GAP
GAP_SetParamValue( TGAP_GEN_DISC_SCAN, 2000 );
GAP_SetParamValue( TGAP_LIM_DISC_SCAN, 2000 );
...}
Each time after a GAP_DEVICE_DISCOVERY_EVENT event, a discovery is started again. Observer always keep detecting if there is broadcaster around and get their advertisement data.
static void simpleBLEObserverEventCB( gapObserverRoleEvent_t *pEvent )
{
switch ( pEvent->gap.opcode )
{
case GAP_DEVICE_DISCOVERY_EVENT:
{
// discovery complete
simpleBLEScanning = FALSE;
// Copy results
simpleBLEScanRes = pEvent->discCmpl.numDevs;
osal_memcpy( simpleBLEDevList, pEvent->discCmpl.pDevList,
(sizeof( gapDevRec_t ) * pEvent->discCmpl.numDevs) );
GAPObserverRole_StartDiscovery( DEFAULT_DISCOVERY_MODE,
DEFAULT_DISCOVERY_ACTIVE_SCAN,
DEFAULT_DISCOVERY_WHITE_LIST );
thanks