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.

Behaviour of BT stack in Piconet and during role change of slave to master

Other Parts Discussed in Thread: CC2564

Hi,

Question 1:

I am using cc256x module and I am using multiple spp comports. At first I connect to connect to "Port 1" and role is happening properly and this comport connection is still occupied with the same device. 

If I use another device to connect on "port 2" then also I am observing that cc256x is changing it's role to master again.

Is it a case that for each SPP port there should be a role change event??? 

Question 2:

When comport 1 is connected to one andriod(phone) device and with the same andriod device(phone)  when I try to connect a completely different device which is also a salve , then the observation is andriod device (phone) is changing to master and then again it is changing to slave. Thus CC256x com1 is changing it's role from master to slave. Thus this effect the role change of another comport say "Port 2 of CC256x".

Question 3:


As a slave to how many devices that cc256x can connect ?? 7 is possible . I am unable to connect more than 2 master devices. core spec says that salve can participate in multiple piconet.

Question 4:


Once device is master can I stop changing it's role ??

Thank you

  • Hi,

    1 & 2. The CC256x will/will not issue a role change request based upon what value you have set to: L2CA_Link_Connect_Params.L2CA_Link_Connect_Request_Config & L2CA_Link_Connect_Params.L2CA_Link_Connect_Response_Config

    The possible values are:

    For: L2CA_Link_Connect_Request_Config -> cqNoRoleSwitch & cqAllowRoleSwitch
    For: L2CA_Link_Connect_Response_Config -> csMaintainCurrentRole, csRequestRoleSwitch

    If you have set: "csMaintainCurrentRole", then the CC256x will not initiate a role switch request on incoming connect requests.

    3. Please check the datasheet.

    – Up to 7 Active Devices
    – Scatternet: Up to 3 Piconets Simultaneously, 1 as Master and 2 as Slaves

    4. Yes, you can configure L2CA_Link_Connect_Request_Config and set it as "cqNoRoleSwitch".

    Regards,
    Gigi Joseph
  • Hi Joseph Gigi,

    Thanks for your response.

    I tried with HCI_master role change. I am not using L2CA events. I will check with it and I will comment the behaviour.

    And regarding question 1, As of now when I connect an andriod device to each SPP comport I am seeing role change to master . Why this behaviour??

    On comport 1 it changed it role. If I connect another device on comport 2 I am still seeing the role change. Once it became master because of comport1 and it remind as master , but why again it is changing it's role??

    I am using HCI_Switch_Role() API for role change

  • Hi,

    The other connection from "another device on comport 2" is another ACL connection, right? Since you may have set "csRequestRoleSwitch" (on accept connection request), the CC256x is requesting role switch on that ACL connection. It is normal behaviour.

    Regards,
    Gigi Joseph.
  • Hello Joseph,

    If the CC21564 is configured as cqAllowRoleSwitch, and ends up as the Slave in a connection, what is the correct method for performing a Role switch to Master?


    Thank you,

    - Jason
  • Hi,
    You can use the API's, HCI_Role_Discovery() and HCI_Switch_Role(). If we (CC2564) are initiating the connection then set the parameter Allow_Role_Switch to false in HCI_Create_Connection() and If the remote device is initiating the connection and if he does not set this parameter to false then you can use the above APIs for the role switch.