Reversed PPoGATT service: the watch hosts the service and the phone is the GATT client.
More...
Reversed PPoGATT service: the watch hosts the service and the phone is the GATT client.
The service has a data characteristic the watch notifies and a data write characteristic the phone writes without response, both requiring an encrypted link. The pbl_bt_cb_ppog_reversed_* callbacks run on the NimBLE host task without bt_lock() held.
}
enum pbl_bt_errno pbl_bt_ppog_reversed_notify(uint16_t conn_handle, const uint8_t *buf, uint16_t len)
Send a PPoGATT packet to the phone as a notification.
pbl_bt_errno
Bluetooth error codes.
Definition types.h:28
@ PBL_BT_ERRNO_NOT_ENOUGH_RESOURCES
The system did not have enough resources for the operation.
Definition types.h:54
◆ pbl_bt_cb_ppog_reversed_data_written()
| void pbl_bt_cb_ppog_reversed_data_written |
( |
uint16_t |
conn_handle, |
|
|
uint8_t * |
buf, |
|
|
uint16_t |
len |
|
) |
| |
|
extern |
Called when the phone wrote a PPoGATT packet to the data write characteristic.
- Parameters
-
| conn_handle | Connection handle. |
| buf | The packet, on the kernel heap. Ownership passes to the callee. |
| len | Length of buf in bytes, never 0. |
◆ pbl_bt_cb_ppog_reversed_subscribed()
| void pbl_bt_cb_ppog_reversed_subscribed |
( |
const struct pbl_bt_device_internal * |
device, |
|
|
uint16_t |
conn_handle |
|
) |
| |
|
extern |
Called when the phone enabled notifications on the data characteristic.
- Parameters
-
◆ pbl_bt_cb_ppog_reversed_unsubscribed()
| void pbl_bt_cb_ppog_reversed_unsubscribed |
( |
uint16_t |
conn_handle | ) |
|
|
extern |
Called when the phone disabled notifications or disconnected.
- Parameters
-
| conn_handle | Connection handle. |
◆ pbl_bt_ppog_reversed_notify()
| enum pbl_bt_errno pbl_bt_ppog_reversed_notify |
( |
uint16_t |
conn_handle, |
|
|
const uint8_t * |
buf, |
|
|
uint16_t |
len |
|
) |
| |
Send a PPoGATT packet to the phone as a notification.
- Parameters
-
| conn_handle | Connection handle. |
| buf | The packet. Copied during the call. |
| len | Length of buf in bytes. |
- Return values
-
| PBL_BT_ERRNO_OK | Sent. |
| PBL_BT_ERRNO_NOT_ENOUGH_RESOURCES | Out of buffers. Transient: retry after a short delay, the stack has no buffers-freed event. |
| PBL_BT_ERRNO_INVALID_STATE | Not connected. |
- Returns
- PBL_BT_ERRNO_INTERNAL_ERROR_BEGIN plus the backend error code on other failures.