PebbleOS v4.47.0-757-g12b6c531f
Loading...
Searching...
No Matches

The connection of the watch: there is one at most, to a central. More...

Macros

#define BT_LINK_REASON_BOND_REMOVED   0xFB
 Reason of a gateway disconnection that is not HCI's: its bond was removed.
 

Functions

void bt_link_init (void)
 Start following the link.
 
void bt_link_deinit (void)
 Drop the link, with no gateway disconnection reported.
 
uint16_t bt_link_get_conn_handle (void)
 Get the connection handle of the link.
 
bool bt_link_is_connected (void)
 Tell whether a central is connected.
 
bool bt_link_is_connected_to (const struct pbl_bt_device_internal *identity)
 Tell whether a bonded peer is the one connected.
 
void bt_link_set_response_time (struct pbl_bt_responsiveness_req *req, enum pbl_bt_response_time_state state, uint16_t max_period_secs)
 Ask for a response time on the link, see pbl_bt_responsiveness_request().
 
void bt_link_read_peer_name (void)
 Read the device name of the peer.
 
void bt_link_copy_peer_name (char *name, size_t size)
 Copy the device name of the peer, empty until it has been read.
 
void bt_link_handle_bond_added (void)
 Tell that a bond was added: the link may be the gateway's now.
 
void bt_link_handle_bond_deleted (void)
 Tell that a bond was deleted: if it was the gateway's, the link is dropped.
 

Detailed Description

The connection of the watch: there is one at most, to a central.

The link becomes the gateway's once it is encrypted and its peer is bonded: only then are the services of the phone used. That, and the loss of it, is reported with PEBBLE_BLE_CONNECTION_EVENT; any connection and disconnection with PBL_BT_PEBBLE_CONNECTION_EVENT.

Macro Definition Documentation

◆ BT_LINK_REASON_BOND_REMOVED

#define BT_LINK_REASON_BOND_REMOVED   0xFB

Reason of a gateway disconnection that is not HCI's: its bond was removed.

Function Documentation

◆ bt_link_copy_peer_name()

void bt_link_copy_peer_name ( char *  name,
size_t  size 
)

Copy the device name of the peer, empty until it has been read.

Parameters
[out]nameThe name.
sizeSize of name.

◆ bt_link_deinit()

void bt_link_deinit ( void  )

Drop the link, with no gateway disconnection reported.

Call before the stack stops.

◆ bt_link_get_conn_handle()

uint16_t bt_link_get_conn_handle ( void  )

Get the connection handle of the link.

Returns
The handle, BLE_HS_CONN_HANDLE_NONE if not connected.

◆ bt_link_handle_bond_added()

void bt_link_handle_bond_added ( void  )

Tell that a bond was added: the link may be the gateway's now.

◆ bt_link_handle_bond_deleted()

void bt_link_handle_bond_deleted ( void  )

Tell that a bond was deleted: if it was the gateway's, the link is dropped.

◆ bt_link_init()

void bt_link_init ( void  )

Start following the link.

Call once the stack runs.

◆ bt_link_is_connected()

bool bt_link_is_connected ( void  )

Tell whether a central is connected.

◆ bt_link_is_connected_to()

bool bt_link_is_connected_to ( const struct pbl_bt_device_internal *  identity)

Tell whether a bonded peer is the one connected.

Parameters
identityIdentity address of the peer.

◆ bt_link_read_peer_name()

void bt_link_read_peer_name ( void  )

Read the device name of the peer.

The name of a bonded peer is kept with its bond, and PEBBLE_BLE_DEVICE_NAME_UPDATED_EVENT is put when it changes.

◆ bt_link_set_response_time()

void bt_link_set_response_time ( struct pbl_bt_responsiveness_req *  req,
enum pbl_bt_response_time_state  state,
uint16_t  max_period_secs 
)

Ask for a response time on the link, see pbl_bt_responsiveness_request().

Parameters
reqRequest of who asks, see struct pbl_bt_responsiveness_req.
stateThe response time.
max_period_secsHow long for.