5 #define L2CAP_CID_SIGNALING 0x0001
6 #define L2CAP_CID_CONNECTIONLESS_CHANNEL 0x0002
7 #define L2CAP_CID_ATTRIBUTE_PROTOCOL 0x0004
8 #define L2CAP_CID_SIGNALING_LE 0x0005
9 #define L2CAP_CID_SECURITY_MANAGER_PROTOCOL 0x0006
17 DISCONNECTION_REQUEST,
18 DISCONNECTION_RESPONSE,
23 } L2CAP_SIGNALING_COMMANDS;
26 PB_FIRST_NON_FLUSH = 0,
39 // Connection result values
40 #define BT_L2CAP_CON_RES_SUCCESS 0x0000
41 #define BT_L2CAP_CON_RES_PENDING 0x0001
42 #define BT_L2CAP_CON_RES_REFUSED_PSM 0x0002
43 #define BT_L2CAP_CON_RES_REFUSED_SECURITY 0x0003
44 #define BT_L2CAP_CON_RES_REFUSED_RSRC 0x0004
46 #define BT_L2CAP_CON_STAT_NOINFO 0x0000
47 #define BT_L2CAP_CON_STAT_AUTHEN_PENDING 0x0001
48 #define BT_L2CAP_CON_STAT_AUTHOR_PENDING 0x0002
51 BT_L2CAP_CON_IDLE = 0,
52 BT_L2CAP_CON_CONNECTED
53 } bt_l2cap_con_state_t;
55 // describes the L2CAP connection
57 bt_l2cap_con_state_t cstate;
60 uint16_t PSM; // PSM of this connection
62 uint16_t locCID; // our local CID
63 uint16_t remCID; // remote host CID
69 void init_l2cap(void);
70 void bt_l2cap_proc_dyn_channel(const uint16_t channel, const uint16_t handle, const void *mdat, uint16_t mlen);
71 uint8_t bt_l2cap_get_connected(const uint16_t channel);
72 void bt_l2cap_send_channel(const uint16_t channel, const void *mdat, uint16_t mlen);
73 void bt_l2cap_proc_signalling(const uint16_t handle, unsigned char *mdat, uint16_t mlen);
74 void bt_l2cap_handle_connection_request(const uint16_t handle, const uint8_t ident, const uint16_t PSM, const uint16_t src_CID);