SWRU271I October 2010 – January 2020 CC2540 , CC2540T , CC2541 , CC2541-Q1 , CC2640R2F
The initialization of the application occurs in two phases. OSAL calls the SimpleBLEPeripheral_Init() function. This function sets up the GAP role profile parameters, GAP characteristics, the GAP bond manager parameters, and simpleGATTprofile parameters. This function also sets an OSAL SBP_START_DEVICE_EVT event.
The processing in this event triggers the second phase of the initialization, which is in the SimpleBLEPeripheral_ProcessEvent() function. During this phase, the GAPRole_StartDevice() function is called to set up the GAP functions. This function sets up the GAP functions of the application. Connectable undirected advertisements make the device discoverable (for CC2540/41DK-MINI keyfob builds, the device becomes discoverable when you press the button on the right). A central device can discover the peripheral device by scanning. If a central device sends a request to connect to the peripheral device, the peripheral device accepts the request and goes into a connected state as a slave. If the peripheral device receives no connection request, the device remains discoverable for 30.72 seconds before going into a standby state.
The project also includes the simpleGATTProfile service. A connected central device operating as a GATT client can perform characteristic reads and writes on simpleGATTProfile characteristic values. The device can also enable notifications of one of the characteristics.