Other Parts Discussed in Thread: CC2640, SYSCONFIG
Hi to everyone,
I'm working with CC2642, SDK_CC26X2_R2_4_40_00_44 and the example used as starting point for my project is the multi_role, heavily modified. The board is a custom board.
This product constantly scan for two different kind of slave and it can be also connected itself from smartphones.
The two kind of slave (let's call them "A" and "B") that must be scanned and (eventually) connected are also custom boards, both based on CC2640_R2.
The slave "A" make Advertising frequently, and once the multi_role scan found it, a connection is formed and kept indefinitely. No problem with it.
The slave "B" works as TAG and because its battery powered, its make one single Advertising every 3 seconds (on the three channels 37,38 and 39).
With no Slave B around multi_role, the multi_role scan is On for 3.5 seconds and Off for 0.2 seconds, indefinitely.
Once the multi_role during the scan found the slave "B", I change the scan parameters timing in order to sincronize the multi_role scanning with Slave B Advertising (this in order to be able to find every next advertising from slave "B").
So once the multi_role have found the first slave B Advertising, the multi_role Scan is set:
- Off for 2.8 seconds (because the next advertising from Slave B will arrive not early than 3 seconds)
Then
- On for just the amount of time to get the next advertising, so ideally for only 0.2 seconds. (On for max 3.5 seconds if no Advertising are found).
And so on
Scan Interval and Scan Wind are both set to 16 (10 millisecond)
The Scan work with white_list of the two Slave
The function called for the scan is GapScan_enable(0, T_ScanDuration, DEFAULT_MAX_SCAN_RES);
I've tryed DEFAULT_MAX_SCAN_RES from 25 to 250 but since I'm working with white list and because I stop the scan if Slave A or B Advertising is found, I thinks this variable is not relevant at all (I'm also not using the function multi_role_addsScanInfo which require this variable to be not greater than a certain value ).
The problem is that often, the scan is missing not one, but three or four Advertising of the Salve B consecutively.
I've tried many different Scan and Interval values, and (thinking also that the multi_role must be connected from smartphone and must keep the connection on with the Slave A) the value 16 for both seems the best option.
I've also check the behaviour of the radio during the scan to be sure everything is working as expected, using
// Map LNA enable pin RFC_GPO0 to DIO06
IOCPortConfigureSet(DIO06, IOC_PORT_RFC_GPO0, IOC_IOMODE_NORMAL);
And I didn't find any issue: when I trigger the Scan On, the radio is working correctly.
I've also tried the multi_role as Central device only, keeping out the PERIPHERAL_CFG configuration. But this doesn't make it better results.
Do you konw if there is a way to obain better result or if am I missing something?
Many thanks for your support
Federico