Tells when the GATT services of a peer change.
More...
Tells when the GATT services of a peer change.
It subscribes to the Service Changed characteristic of the peer's GATT service. The clients of the peer's other services then look for theirs again, e.g. with pbl_bt_gattc_service_rediscover().
◆ pbl_bt_service_changed_client
| struct pbl_bt_service_changed_client |
◆ PBL_BT_SERVICE_CHANGED_CLIENT_DEFINE
| #define PBL_BT_SERVICE_CHANGED_CLIENT_DEFINE |
( |
|
_name | ) |
|
Value:
static bool _name##_notify_rx(uint16_t conn_handle, uint16_t attr_handle, struct os_mbuf *om) { \
return pbl_bt_service_changed_client_notify_rx(&_name, conn_handle, attr_handle, om); \
} \
PBL_BT_GATTC_NOTIFY_LISTENER_DEFINE(_name, _name##_notify_rx)
A client.
Definition service_changed.h:34
Define a client.
- Parameters
-
◆ pbl_bt_service_changed_cb_t
The services of the peer changed.
Called on the host task.
- Parameters
-
| client | Client. |
| start_handle | First attribute handle affected. |
| end_handle | Last attribute handle affected. |
◆ pbl_bt_service_changed_client_start()
Look for the characteristic on a connection, and subscribe to it.
A peer without it never changes its services, and nothing is reported.
- Parameters
-
| client | Client. |
| conn_handle | Connection. |
| cb | Called when the services change. |
- Returns
- 0 on success, -EALREADY if the client is started, another negative errno otherwise.
◆ pbl_bt_service_changed_client_stop()
Stop a client, e.g.
when its connection is gone.
- Parameters
-