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.

Bluetooth LE module GAP role to act as either a Master or a Slave

Other Parts Discussed in Thread: CC2540, CC2640

I am building on the CC2540 Bluetooth LE chipset and programming them in IAR. I am working to create modules that can act as either a Master or a Slave.

They both start out Advertising as scannable and connectable. I can externally command one of the running modules to start a Discovery scan, while still Advertising. Then initiate either module to connect to the other as the Master causing the other to become the slave.

The problem is in my understanding of the GAP layer. There are the 2 main roles:

  • Peripheral – an advertiser that is connectable, and operates as a slave in a single link-layer connection.
  • Central – scans for advertisements and initiates connections; operates as a master in a single or multiple link-layer connections.

I need functionality from both, so I have no idea which role to program into my modules

  • Hi Josh,


    The CC2540 is a BT4.0 product and as such,does not support the BT4.1 simultaneous Master / Slave roles. This feature is available in the CC2640, which is BT4.1 certified.

    For CC2540, if you want to change the role, you will need to call GAP_DeviceInit to reinitialize the BLE stack in the Center or Peripheral role.


    Best wishes