20#ifndef H_L2CAP_COC_PRIV_
21#define H_L2CAP_COC_PRIV_
24#include "nimble/porting/nimble/include/syscfg/syscfg.h"
25#include "nimble/porting/nimble/include/os/queue.h"
26#include "nimble/porting/nimble/include/os/os_mbuf.h"
27#include "nimble/nimble/host/include/host/ble_l2cap.h"
28#include "ble_l2cap_sig_priv.h"
33#define BLE_L2CAP_COC_CID_START 0x0040
34#define BLE_L2CAP_COC_CID_END 0x007F
38#define BLE_L2CAP_COC_FLAG_STALLED 0x01
40struct ble_l2cap_coc_endpoint {
48struct ble_l2cap_coc_srv {
49 STAILQ_ENTRY(ble_l2cap_coc_srv) next;
52 ble_l2cap_event_fn *cb;
56#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) != 0
57int ble_l2cap_coc_init(
void);
58int ble_l2cap_coc_create_server(uint16_t psm, uint16_t mtu,
59 ble_l2cap_event_fn *cb,
void *cb_arg);
60int ble_l2cap_coc_create_srv_chan(
struct ble_hs_conn *conn, uint16_t psm,
61 struct ble_l2cap_chan **chan);
62struct ble_l2cap_chan * ble_l2cap_coc_chan_alloc(
struct ble_hs_conn *conn,
63 uint16_t psm, uint16_t mtu,
65 ble_l2cap_event_fn *cb,
67void ble_l2cap_coc_cleanup_chan(
struct ble_hs_conn *conn,
struct ble_l2cap_chan *chan);
68void ble_l2cap_coc_le_credits_update(uint16_t conn_handle, uint16_t dcid,
70int ble_l2cap_coc_recv_ready(
struct ble_l2cap_chan *chan,
72int ble_l2cap_coc_send(
struct ble_l2cap_chan *chan,
struct os_mbuf *sdu_tx);
73void ble_l2cap_coc_set_new_mtu_mps(
struct ble_l2cap_chan *chan, uint16_t mtu, uint16_t mps);
76ble_l2cap_coc_init(
void) {
81ble_l2cap_coc_create_server(uint16_t psm, uint16_t mtu,
82 ble_l2cap_event_fn *cb,
void *cb_arg) {
83 return BLE_HS_ENOTSUP;
87ble_l2cap_coc_recv_ready(
struct ble_l2cap_chan *chan,
89 return BLE_HS_ENOTSUP;
93ble_l2cap_coc_cleanup_chan(
struct ble_hs_conn *conn,
struct ble_l2cap_chan *chan) {
97ble_l2cap_coc_send(
struct ble_l2cap_chan *chan,
struct os_mbuf *sdu_tx) {
98 return BLE_HS_ENOTSUP;