|
PebbleOS v4.47.0-757-g12b6c531f
|
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. | |
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.
| #define BT_LINK_REASON_BOND_REMOVED 0xFB |
Reason of a gateway disconnection that is not HCI's: its bond was removed.
| void bt_link_copy_peer_name | ( | char * | name, |
| size_t | size | ||
| ) |
Copy the device name of the peer, empty until it has been read.
| [out] | name | The name. |
| size | Size of name. |
| void bt_link_deinit | ( | void | ) |
Drop the link, with no gateway disconnection reported.
Call before the stack stops.
| uint16_t bt_link_get_conn_handle | ( | void | ) |
Get the connection handle of the link.
BLE_HS_CONN_HANDLE_NONE if not connected. | 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.
| void bt_link_init | ( | void | ) |
Start following the link.
Call once the stack runs.
| 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.
| identity | Identity address of the peer. |
| 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.
| 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().
| req | Request of who asks, see struct pbl_bt_responsiveness_req. |
| state | The response time. |
| max_period_secs | How long for. |