This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Peripheral states



I've found the following figure in a developer's BLE handbook, which shows a number of states a peripheral device can be in:

However in TI's stack (peripheral.h), states are different:

/**
 * GAP Peripheral Role States.
 */
typedef enum
{
  GAPROLE_INIT = 0,                       //!< Waiting to be started
  GAPROLE_STARTED,                        //!< Started but not advertising
  GAPROLE_ADVERTISING,                    //!< Currently Advertising
  GAPROLE_WAITING,                        //!< Device is started but not advertising, is in waiting period before advertising again
  GAPROLE_WAITING_AFTER_TIMEOUT,          //!< Device just timed out from a connection but is not yet advertising, 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
} gaprole_States_t;

Most important states which are missing is directed advertising and connectable advertising.

Am i just looking in the wrong place?

  • Hello Andrey,
    The figure is named typical states and should therefore not be considered a complete overview. For example the peripheral device can be set up to send non-connectable advertisements as well. Within the state advertising you can set the type of advertising you want. So all the different forms of advertisements are within this same state, but with different configurations. In SimpleBLEPeripheral this is initially set in the GAPRole_Init function where the following is set:

    gapRole_AdvEventType = GAP_ADTYPE_ADV_IND;

    Which is Connectable undirected advertisements. You can change this, but if you change it here you will need to modify the advertisement data and more to be consistent.