www.ti.com
Callbacks
115
SWRU271H–October 2010–Revised April 2019
Submit Documentation Feedback
Copyright © 2010–2019, Texas Instruments Incorporated
GAPRole Peripheral Role API
ParamID R/W Size Description
GAPROLE_TIMEOUT_MULTIPLIER R/W uint16 Supervision timeout to use for
a parameter update (n × 10
ms). Range: 100 ms to 32 sec.
Default is 1000 ms.
GAPROLE_CONN_BD_ADDR R uint8[6] Address of connected device.
GAPROLE_CONN_INTERVAL R uint16 Current connection interval.
GAPROLE_CONN_LATENCY R uint16 Current slave latency.
GAPROLE_CONN_TIMEOUT R uint16 Current supervision timeout.
GAPROLE_PARAM_UPDATE_REQ W uint8 Set this to TRUE to send a
parameter update request.
GAPROLE_STATE R uint8 Gap peripheral role state
(enumerated in
gaprole_States_t in
peripheral.h)
B.3 Callbacks
These callbacks are functions whose pointers are passed from the application to the GAPRole so the
GAPRole can return events to the application. They are passed as the following:
For an example, see the SimpleBLEPeripheral application.
B.3.1 State Change Callback (pfnStateChange)
This callback passes the current GAPRole state to the application whenever the state changes. This
function is of the following type:
The GAPRole states (newState) are the following:
• GAPROLE_INIT //!< Waiting to be started
• GAPROLE_STARTED //!< Started but not advertising
• GAPROLE_ADVERTISING_NONCONN //!< Currently using nonconnectable Advertising
• GAPROLE_WAITING //!< Device is started but not advertising; it is in waiting period before advertising
again
• GAPROLE_WAITING_AFTER_TIMEOUT //!< Device just timed out from a connection but is not yet
advertising; it is in waiting period before advertising again
• GAPROLE_CONNECTED //!< In a connection
• GAPROLE_CONNECTED_ADV //!< In a connection + advertising
• GAPROLE_ERROR //!< Error occurred – invalid state