Hello
I have read several topics about multi connection from one Central to several Peripheral devices, but still have some questions about such a process for BLE5 stack.
I'm using "simplelink_cc2640r2_sdk_3_10_00_15" SDK and my application is based on "SimpleCentral" example program that I modified to have an autonomous connection to one peripheral with a specific name that was discovered.
At this step all is OK and works perfectly.
My next step is to connect my Central device up to 3 peripherals at the same time to send commands and data.
I can't find a good solution for that.
Do someone can help me ?
Here is my progress and analyze :
- I start by calling "SimpleCentral_doDiscoverDevice()" which lists all the advertising Peripherals with the specific name I'm looking for (I don't use pairing and I dont want to use it)
- Then the main task receives SC_EVT_ADV_REPORT event which is processed by "ProcessAppMsg()" for each discovered Peripheral
- "ProcessAppMsg()" then updates global variables 'numScanRes' and 'scanList[]' with discovered Peripheral datas
- An SC_EVT_SCAN_DISABLED event is then received and processeg by ProcessAppMsg() indicating that scannoing process has ended
- On this event received, ProcessAppMsg() calls "SimpleCentral_doConnect()" to initiate the connection on the found Peripheral (infact, it calls the "GapInit_connect()" function from BLE5-Stack).
I tried to modify at this step by adding a loop to ask for all discovered Peripheral listed in 'scanList[]' but it seems that I only receive one time the next event which is GAP_LINK_ESTABLISHED_EVENT, processed by "ProcessGapMsg()". From my analyze and understanding, It is supposed to update the global variables 'connList[]' an 'numConn', but this is not the situation I observe.
Could someone help me and told me what is the best way to do into this project ?
THank you in advance for any help.
Best regards.Patrick