PebbleOS
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
LE connections

LE connection events and disconnection. More...

Data Structures

struct  pbl_bt_conn_params
 Parameters of an established connection. More...
 
struct  pbl_bt_remote_version_info
 Link layer version of a peer, as in LL_VERSION_IND (v4.2, Vol 6, Part B, 2.4.2.13). More...
 
struct  pbl_bt_remote_version_info_received_event
 Remote version information of a peer was received. More...
 
struct  pbl_bt_conn_complete_event
 A connection was established (LE Connection Complete Event, 7.7.65.1). More...
 
struct  pbl_bt_disconn_complete_event
 A connection was terminated (Disconnection Complete Event, 7.7.5). More...
 
struct  pbl_bt_conn_update_complete_event
 Connection parameters were updated (LE Connection Update Complete Event, 7.7.65.3). More...
 
struct  pbl_bt_encryption_change
 Link encryption changed (Encryption Change Event, 7.7.8). More...
 
struct  pbl_bt_addr_change
 The address of a connected peer changed, typically once its identity was resolved. More...
 
struct  pbl_bt_irk_change
 The IRK of a peer changed. More...
 

Enumerations

enum  pbl_bt_addr_type { PBL_BT_ADDR_TYPE_PUBLIC , PBL_BT_ADDR_TYPE_RANDOM }
 LE address type. More...
 

Functions

int pbl_bt_gap_le_disconnect (const struct pbl_bt_device_internal *peer_address)
 Terminate a connection.
 
void pbl_bt_handle_le_connection_complete_event (const struct pbl_bt_conn_complete_event *event)
 Called when a connection is established.
 
void pbl_bt_handle_le_disconnection_complete_event (const struct pbl_bt_disconn_complete_event *event)
 Called when a connection is terminated.
 
void pbl_bt_handle_le_encryption_change_event (const struct pbl_bt_encryption_change *event)
 Called when the encryption of a connection changes.
 
void pbl_bt_handle_le_conn_params_update_event (const struct pbl_bt_conn_update_complete_event *event)
 Called when the parameters of a connection were updated.
 
void pbl_bt_handle_le_connection_handle_update_address (const struct pbl_bt_addr_change *e)
 Called when the identity address of a connected peer was resolved.
 
void pbl_bt_handle_le_connection_handle_update_irk (const struct pbl_bt_irk_change *e)
 Called when a new IRK of a peer was stored.
 
void pbl_bt_handle_peer_version_info_event (const struct pbl_bt_remote_version_info_received_event *e)
 Called when the link layer version of a peer was received.
 

Detailed Description

LE connection events and disconnection.

The event structures carry the data of the HCI events of the Bluetooth Core Specification v4.2, Vol 2, Part E, 7.7, noted on each. The firmware implements the pbl_bt_handle_le_* callbacks; unless noted otherwise they are invoked on the NimBLE host task.


Data Structure Documentation

◆ pbl_bt_conn_params

struct pbl_bt_conn_params

Parameters of an established connection.

Data Fields
uint16_t conn_interval_1_25ms Connection interval in 1.25 ms units.
uint16_t slave_latency_events Peripheral latency, in connection events.
uint16_t supervision_timeout_10ms Supervision timeout in 10 ms units.

◆ pbl_bt_remote_version_info

struct pbl_bt_remote_version_info

Link layer version of a peer, as in LL_VERSION_IND (v4.2, Vol 6, Part B, 2.4.2.13).

Data Fields
uint16_t company_identifier Company identifier of the controller manufacturer.
uint16_t subversion_number Implementation specific subversion.
uint8_t version_number Bluetooth Core Specification version.

◆ pbl_bt_remote_version_info_received_event

struct pbl_bt_remote_version_info_received_event

Remote version information of a peer was received.

Data Fields
struct pbl_bt_device_internal peer_address The peer.
struct pbl_bt_remote_version_info remote_version_info The peer's version information.

◆ pbl_bt_conn_complete_event

struct pbl_bt_conn_complete_event

A connection was established (LE Connection Complete Event, 7.7.65.1).

Data Fields
struct pbl_bt_conn_params conn_params Connection parameters.
uint16_t handle Connection handle.
struct pbl_bt_sm_key irk The peer's IRK.

Valid iff is_resolved is true.

bool is_master True if the local device is the central.
bool is_resolved True if the peer's address was resolved with a stored IRK.
uint16_t mtu Current ATT MTU.
struct pbl_bt_device_internal peer_address The peer, by its identity address when it is known.
enum pbl_bt_hci_status status Status.

The NimBLE backend only reports successful connections.

◆ pbl_bt_disconn_complete_event

struct pbl_bt_disconn_complete_event

A connection was terminated (Disconnection Complete Event, 7.7.5).

Data Fields
uint16_t handle Connection handle.
struct pbl_bt_device_internal peer_address The peer.
enum pbl_bt_hci_status reason Reason of the disconnection.

The NimBLE backend reports its own error codes.

enum pbl_bt_hci_status status Status of the disconnection.

◆ pbl_bt_conn_update_complete_event

struct pbl_bt_conn_update_complete_event

Connection parameters were updated (LE Connection Update Complete Event, 7.7.65.3).

Data Fields
struct pbl_bt_conn_params conn_params New connection parameters.
struct pbl_bt_addr dev_address Address of the peer.

The address type is not available.

enum pbl_bt_hci_status status Status.

The NimBLE backend only reports successful updates.

◆ pbl_bt_encryption_change

struct pbl_bt_encryption_change

Link encryption changed (Encryption Change Event, 7.7.8).

Data Fields
struct pbl_bt_addr dev_address Address of the peer.

The address type is not available.

bool encryption_enabled True if the link is now encrypted.
enum pbl_bt_hci_status status Status.

The NimBLE backend reports its own error codes.

◆ pbl_bt_addr_change

struct pbl_bt_addr_change

The address of a connected peer changed, typically once its identity was resolved.

Data Fields
struct pbl_bt_device_internal device Current device address.
struct pbl_bt_device_internal new_device New device address.

◆ pbl_bt_irk_change

struct pbl_bt_irk_change

The IRK of a peer changed.

Data Fields
struct pbl_bt_device_internal device The peer.
struct pbl_bt_sm_key irk Identity Resolving Key.
bool irk_valid True if irk is valid.

Enumeration Type Documentation

◆ pbl_bt_addr_type

LE address type.

One byte in size.

Enumerator
PBL_BT_ADDR_TYPE_PUBLIC 

Public device address.

PBL_BT_ADDR_TYPE_RANDOM 

Random device address.

Function Documentation

◆ pbl_bt_gap_le_disconnect()

int pbl_bt_gap_le_disconnect ( const struct pbl_bt_device_internal *  peer_address)

Terminate a connection.

Completion is reported through pbl_bt_handle_le_disconnection_complete_event().

Parameters
peer_addressThe peer to disconnect from.
Return values
0The disconnection was initiated.
-1There is no connection with peer_address.
Returns
A positive NimBLE error code if the termination could not be initiated.

◆ pbl_bt_handle_le_conn_params_update_event()

void pbl_bt_handle_le_conn_params_update_event ( const struct pbl_bt_conn_update_complete_event *  event)
extern

Called when the parameters of a connection were updated.

Parameters
eventThe new parameters.

◆ pbl_bt_handle_le_connection_complete_event()

void pbl_bt_handle_le_connection_complete_event ( const struct pbl_bt_conn_complete_event *  event)
extern

Called when a connection is established.

Parameters
eventThe connection.

◆ pbl_bt_handle_le_connection_handle_update_address()

void pbl_bt_handle_le_connection_handle_update_address ( const struct pbl_bt_addr_change *  e)
extern

Called when the identity address of a connected peer was resolved.

Parameters
eThe address change.

◆ pbl_bt_handle_le_connection_handle_update_irk()

void pbl_bt_handle_le_connection_handle_update_irk ( const struct pbl_bt_irk_change *  e)
extern

Called when a new IRK of a peer was stored.

Invoked on KernelMain by the NimBLE backend.

Parameters
eThe IRK change.

◆ pbl_bt_handle_le_disconnection_complete_event()

void pbl_bt_handle_le_disconnection_complete_event ( const struct pbl_bt_disconn_complete_event *  event)
extern

Called when a connection is terminated.

Parameters
eventThe disconnection.

◆ pbl_bt_handle_le_encryption_change_event()

void pbl_bt_handle_le_encryption_change_event ( const struct pbl_bt_encryption_change *  event)
extern

Called when the encryption of a connection changes.

Parameters
eventThe encryption change.

◆ pbl_bt_handle_peer_version_info_event()

void pbl_bt_handle_peer_version_info_event ( const struct pbl_bt_remote_version_info_received_event *  e)
extern

Called when the link layer version of a peer was received.

Not invoked by the NimBLE backend.

Parameters
eThe version information.