|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
RFCOMM DLC operations structure. More...
#include <rfcomm.h>
Data Fields | |
| void(* | connected )(struct bt_rfcomm_dlc *dlc) |
| DLC connected callback. | |
| void(* | disconnected )(struct bt_rfcomm_dlc *dlc) |
| DLC disconnected callback. | |
| int(* | recv )(struct bt_rfcomm_dlc *dlc, struct net_buf *buf) |
| DLC recv callback. | |
| void(* | sent )(struct bt_rfcomm_dlc *dlc, int err) |
| DLC sent callback. | |
RFCOMM DLC operations structure.
The object has to stay valid and constant for the lifetime of the DLC.
| void(* bt_rfcomm_dlc_ops::connected) (struct bt_rfcomm_dlc *dlc) |
DLC connected callback.
If this callback is provided it will be called whenever the connection completes.
| dlc | The dlc that has been connected |
| void(* bt_rfcomm_dlc_ops::disconnected) (struct bt_rfcomm_dlc *dlc) |
DLC disconnected callback.
If this callback is provided it will be called whenever the dlc is disconnected, including when a connection gets rejected or cancelled (both incoming and outgoing)
| dlc | The dlc that has been Disconnected |
| int(* bt_rfcomm_dlc_ops::recv) (struct bt_rfcomm_dlc *dlc, struct net_buf *buf) |
DLC recv callback.
Called whenever data is received on the DLC.
If processing buf requires work that cannot complete immediately (e.g. passing data to another thread or a work queue), return -EINPROGRESS to defer the completion. The callback must not block in this case. Then the stack will hold back RX flow-control credits (CFC) or assert FC=1 (non-CFC) until bt_rfcomm_dlc_recv_complete is called for every outstanding buffer.
When -EINPROGRESS is returned, the application takes ownership of the buf reference and must eventually call bt_rfcomm_dlc_recv_complete exactly once, passing back the same buf pointer. No net_buf_ref or net_buf_unref calls are needed around that hand-off.
-EINVAL.| dlc | The dlc receiving data. |
| buf | Buffer containing incoming data. |
| 0 | Data was fully consumed synchronously; the stack retains ownership of buf. |
| -EINPROGRESS | Data processing is deferred; the application now owns buf and must call bt_rfcomm_dlc_recv_complete once processing is done. |
| void(* bt_rfcomm_dlc_ops::sent) (struct bt_rfcomm_dlc *dlc, int err) |
DLC sent callback.
| dlc | The dlc which has sent data. |
| err | Sent result. |