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