Hello,
I know that a number of these items within this post have been discussed elsewhere, but I have yet to find a post that adequately answers my questions. Please feel free to refer me to posts that I may have missed.
I am designing system that has very tight power constraints. As such I have defined the following parameters:
- Scanning Interval 5 minutes
- Scanning Window 6.6 seconds ( this window has the ability to catch 2 advertisements)
Scan Interval Count = ( 5 min * 60 sec/min * 1000 ms/sec ) / ( 0.625 ms/cnt ) = 480,000 à 19-bits
Since, my scan interval cannot be represented by a 16-bit count, I am using a OSAL timer to manage when I call the GAPCentralRole_StartDiscovery function. This has worked fairly well, especially since the completion of the discovery procedure is indicated by the GAP_DEVICE_DISCOVERY_EVENT.
If the device address is known, I would like to use the GAPCentralRole_EstablishLink function with the same timing parameters. This has been a bit more difficult, because there isn’t an event tied to the “completion” of connection establishment scan window.
So, my question to the community are
1) How would you recommend accomplishing this if the TGAP*SCAN_INT parameters are essentially useless?
2) How can you specify limited verse general discovery/establishment procedures?
I’ve had limited success doing the following:
SetupScanning( 6600, 300000 );
static void SetupScanning( uint32 setScanWindowMs,
uint32 setScanIntervalMs)
{
scanWindowMs = setScanWindowMs;
scanIntervalMs = setScanIntervalMs;
uint16 winCnt = (uint16) ( ( MS_PER_SEC * setScanWindowMs )
/ (uint32) 625 );
HAL_ASSERT( winCnt != 0 );
// Scanning/Discovery Parameters
GAP_SetParamValue( TGAP_GEN_DISC_SCAN,
scanWindowMs );
GAP_SetParamValue( TGAP_LIM_DISC_SCAN,
scanWindowMs );
GAP_SetParamValue( TGAP_CONN_SCAN_INT,
winCnt );
GAP_SetParamValue( TGAP_CONN_SCAN_WIND,
winCnt );
GAP_SetParamValue( TGAP_CONN_HIGH_SCAN_INT,
winCnt );
GAP_SetParamValue( TGAP_CONN_HIGH_SCAN_WIND,
winCnt );
GAP_SetParamValue( TGAP_GEN_DISC_SCAN_INT,
winCnt );
GAP_SetParamValue( TGAP_GEN_DISC_SCAN_WIND,
winCnt );
GAP_SetParamValue( TGAP_LIM_DISC_SCAN_INT,
winCnt );
GAP_SetParamValue( TGAP_LIM_DISC_SCAN_WIND,
winCnt );
GAP_SetParamValue( TGAP_CONN_EST_SCAN_INT,
winCnt );
GAP_SetParamValue( TGAP_CONN_EST_SCAN_WIND,
winCnt );
}
Thanks for your help!