ble/stack/peripheral.h header reference
[Bluetooth Low Energy library module]

The source code of this header can be browsed online.

Description [link] 

this header contains definitions for a Peripheral context stack utility.

Members [link] 

Types [link] 

Functions [link] 

Members detail [link] 

#define BLE_STACK_PERIPHERAL_H [link] 

This macro is declared in ble/stack/peripheral.h source file, line 30.

void ble_peripheral_cleanup(struct ble_peripheral_s *peri) [link] 

This function is declared in ble/stack/peripheral.h source file, line 154.

struct ble_peripheral_handler_s [link] 

This struct is declared in ble/stack/peripheral.h source file, line 80.

this struct defines the set of functions a peripheral context can call back. They allow the peripheral context to meet caller's expectations.

FieldDescription
struct ble_stack_connection_handler_s base;Connection-specific callbacks
bool_t (*connection_requested)(struct ble_peripheral_s *peri, const struct ble_addr_s *addr) ;this variable asks the handler whether connection request from address addr should be accepted.
void (*state_changed)(struct ble_peripheral_s *peri, enum ble_peripheral_state_e state) ;this variable notifies the handler of new peripheral state. This will typically change on accepted connection request, connection drop, or mode change.

struct ble_peripheral_handler_s * ble_peripheral_handler_s_from_base(void *x) [link] 

This function is declared in ble/stack/peripheral.h source file, line 102.

error_t ble_peripheral_init(struct ble_peripheral_s *peri, const struct ble_peripheral_params_s *params, const struct ble_peripheral_handler_s *handler, struct ble_stack_context_s *context) [link] 

This function is declared in ble/stack/peripheral.h source file, line 146.

this function initializes a peripheral stack context.

enum ble_peripheral_mode_e [link] 

This enum is declared in ble/stack/peripheral.h source file, line 65.

this enum is a or-mask of device supported actions. Mode should be updated through calls to ble_peripheral_mode_set.

IdentifierDescription
BLE_PERIPHERAL_DISCOVERABLEPeripheral will advertise
BLE_PERIPHERAL_PAIRABLEAccept connections from any host, even not in whitelist
BLE_PERIPHERAL_CONNECTABLEPeripheral will accept connections

void ble_peripheral_mode_set(struct ble_peripheral_s *peri, uint8_t mode) [link] 

This function is declared in ble/stack/peripheral.h source file, line 152.

this function sets peripheral mode. If passed mode implies connection is not possible, current connection gets dropped, if any.

struct ble_peripheral_params_s [link] 

This struct is declared in ble/stack/peripheral.h source file, line 108.

this struct is peripheral parameters.

FieldDescription
enum ble_phy_mode_e phy;
uint32_t adv_interval_ms;Interval in milliseconds between two advertising events.

struct ble_peripheral_s [link] 

This struct is declared in ble/stack/peripheral.h source file, line 126.

this struct is an utility for easy declaration of a typical Peripheral role. This utility uses a stack context as data source, advertises for device properties, and waits for a connection request.

Upon connection request, if handler accepts the connection, advertising stops util connection closes. To this extent, this utility handles only one concurrent connection.

struct ble_peripheral_s * ble_peripheral_s_from_conn(void *x) [link] 

This function is declared in ble/stack/peripheral.h source file, line 137.

enum ble_peripheral_state_e [link] 

This enum is declared in ble/stack/peripheral.h source file, line 48.

this enum is a list of states a peripheral may be in.

IdentifierDescription
BLE_PERIPHERAL_IDLEPeripheral is not connected, not advertising
BLE_PERIPHERAL_RECONNECTINGPeripheral is not connected, fast advertising
BLE_PERIPHERAL_ADVERTISINGPeripheral is not connected, normally advertising
BLE_PERIPHERAL_PAIRINGPeripheral is connected to a non-paired device
BLE_PERIPHERAL_CONNECTEDPeripheral is connected to a paired device
Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:05 2022 using MkDoc