Master Slave Switch
Master Slave Switch
Master Slave Switch
MasterSlaveSwitch
Bluetooth Low Energy Wiki Main Page [1]
Requirements
2 CC2540/1 KeyFob's
Texas Instruments Stack 1.4.1 (www.ti.com/blestack)
CC Debugger
Project Files
The patch is found here:
Apply this patch to the $INSTALL$ directory of the stack: C:\Texas Instruments\BLE-CC254x-1.4.1.43908 by
default. Select yes to replace all files.
The project will then be located at $INSTALL$\Projects\ble\SimpleBLESwitch
Operation
1. Flash each keyfob with the SimpleBLESwitch project.
2. Upon power on, the keyFobs will both be advertising. Press the left button on keyFob#1 to change its role to
master. This will also cause it to connect to keyfob#2
3. It is possible to connect to multiple peripherals. Since the user interface on the keyfob is limited, the addresses
which the central will attempt to connect to are hardcoded in the project in SimpleBLESwitch_Init() in
simpleBLESwitch.c:
File Modification
The only profile which requires modification is peripheral.c., to remove a check for gapRole_state in
GAPRole_StartDevice. This is included in the patch here.
In OSAL_SimpleBLESwitch.c the tasksArr must be update to include the central task
(GAPCentralRole_ProcessEvent)
/* Profiles */
GAPRole_Init( taskID++ );
GAPCentralRole_Init( taskID++ ); //Add Central task here
GAPBondMgr_Init( taskID++ );
In simpleBLESwitch.c in the simpleBLESwitch_Handlekeys() function the following call to the osal timer is
changed to use the proper taskID:
References
[1] http:/ / processors. wiki. ti. com/ index. php/ Category:BluetoothLE
Article Sources and Contributors 4