5.3.2 Central Role
The central GAPRole task is defined in central.c and central.h. For the full API including commands, configurable parameters, events, and callbacks, see Section C.
To use this module, do the following:
- Initialize the GAPRole parameters. Section B.2 defines these parameters. Define the parameters in the application initialization function (that is, SimpleBLECentral_init()).
- Initialize the GAPRole task. Do this initialization when processing START DEVICE EVT. This initialization involves passing function pointers to application callback functions. Section C.3 defines these callbacks.
- Send GAPRole commands from the application. The following is an example of the application using GAPCentralRole_StartDiscovery().
NOTE
The return value from the Bluetooth Low Energy protocol stack only indicates whether the attempt to perform device discovery was initiated or not. The termination of connection event is returned asynchronously and is described in the following step. For the list of return parameter associated with each API, see Section A through Section G.
- The GAPRole task processes some of the GAP-related events passed to it from the Bluetooth Low Energy protocol stack. The task forwards some events to the application. The following is an example tracing the GAP_DEVICE_DISCOVERY_EVENT from the Bluetooth Low Energy protocol stack to the application.