This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Slave Multi Connection CC2650

Other Parts Discussed in Thread: CC2650, CC2541, CC2640

Hi all,

I am working with the new BLE_STACK 2.2.0 and I would like my slave device to be able to be connected with 2 master devices at the same time.

Is it possible? If yes how can I do it?

Thanks in advance,

Sylvain 

  • Is your master another CC2650 or is it some other mobile application device?
    For a CC2650, you can change the predefined MAX_NUM_BLE_CONNS option which will impact heap memory requirements. See the software developer's guide.

    Tom
  • Hi Tom, thanks for the reply,

    One master will probably be a CC2541 and the other one a CC2650.

    I changed the MAX_NUM_BLE_CONNS but I still can't connect to the two masters at the same time. I cannot see the device advertising while he already is connected to another device even though I call the HidDev_StartAdvertising();

    I'm worried that I could be in that case (note in the ble_user_config.h) :
    -When the GAP role includes Peripheral and no v4.1 Controller features are configured, MAX_NUM_BLE_CONNS must not be greater than 1

    Is there examples of multiple connections on the stack and especially a slave that can be connected to 2 masters at the time.

    Thanks in advance,

    Sylvain
  • I am interrested : I want to connect a CC2640 to 2 master phones.
    Similar questions are often replied with "see the multirole example". But this is not a fully satisfying answer :
    1) multirole is not what I need (it's overkill, I just want to program a slave connectable by 2 master).
    2) there is no documentation about how this example works : I tried it and checked that I can connect 2 masters, good, but I still don't understand what makes it work better than the "simplePeripheral example + increased MAX_NUM_BLE_CONNS + stack with v4.1 feature".
  • Hi Philippe, 

    Did you succeed to connect to your 2 masters phone? I still can't do it on my side!

    Thanks in advance

    Sylvain

  • Hi Sylvain,

    Yes, I managed to connect 2 masters phone to the CC2640 as peripheral.

    1)  In the stack file "build_config.opt", uncomment the V41_CTRL_CFG feature

    2)  set the MAX_NUM_BLE_CONNS to 2 in the predefined preprocessor symbols

    3) Then most of the work is related to the gapRole implementation (file "peripheral.c"). The one delivered with the simple-peripheral example is really not compatible with a multi-master set-up but I managed to make it "pretty much work" with only a few modifications, though I suspect a lot more work has to be done to improve stability.

    Since then I made more modifications specific to my use-case, so I will try to remember only the relevant ones :

    - in function GAPRole_SetParameter(...) , case GAPROLE_ADVERT_ENABLED: change the condition for calling gapRole_setEvent(START_ADVERTISING_EVT), instead, compare linkDB_NumActive() with MAX_NUM_BLE_CONNS

    - in function gapRole_processGAPMsg(...) , case GAP_LINK_ESTABLISHED_EVENT: re-enable the advertising by calling to GAPRole_setParameter(GAPROLE_ADVERT_ENABLE,...)

    - in function GAPRole_sendUpdateParam(...), do not return bleNotConnected if gapRole_state is GAPROLE_CONNECTED_ADV

    I found these modifications by comparing with the multirole example, which is indeed better adapted to multiconnections. It would be great if TI could deliver a BLE stack "developper's guide" documentation based on this example.

  • Hi Philippe, 

    I tried your solution and it does work, but I couldn't do everything I wanted to do then I started again with my application but I switch from peripheral.c to multi.c in the profiles, here's how I did it.

    In the stack, in build_config.opt :

    -DHOST_CONFIG=PERIPHERAL_CFG must be the only one left in BLE Host Build Configurations

    -DBLE_V41_FEATURES=V41_CTRL_CFG  must also be uncomment

    In the app :

    In the preprocessor options add MAX_NUM_BLE_CONNS=x , with x the number of max connections you want.

    - Then replace peripheral.c and .h with multi.c and multi.h ( you then have to change all the corresponding includes..

    - In multi.c, gapRole_init(void), you need to comment GAP_PROFILE_CENTRAL and leave only 

    -          Dans multi.c, gapRole_init(void) il faut enlever GAP_PROFILE_CENTRAL et ne laisser que GAP_PROFILE_PERIPHERAL for the gapRole_profileRole

    - Then it is dependant of your application but the GAPROLE states are less accurate you should prefer linkDB_NumActive() that indicates the number of active connections

    - Finally in most of the GAP function calls you need to add the corresponding connHandle

    I hope this will help some of you!

  • Hi All,

    I am using CC2640R2 stack (1_30_00_25) - Host_test project. I need to create the BLE module as peripheral and i need to connect with 2 Central (IOS application).

    But i can able to connect with only one iphone , I have changed the MAX_BLE_Conn = 8 and i can able to see the adv pkt after connecting with one IOS application in BTOOL and NRF connect application.

    But i can't able to connect with the second device. when i am sending Establish link request i am not getting any event from BLE board.

    I need to know i am missing any configuration (Macros) to define. Any one give me solution for this issue. Waiting for your reply.

    Thanks in advance,
  • Hi Shri,

    MAX_BLE_CONN is not the only change you have to make in order to be able to connect to multiple devices.
    You shoud try to follow alll the changes I gave in my previous post.

    Sylvain