Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
rfcomm.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_RFCOMM_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_RFCOMM_H_
12
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* RFCOMM channels (1-30): pre-allocated for profiles to avoid conflicts */
28enum {
34};
35
36struct bt_rfcomm_dlc;
37
47 void (*connected)(struct bt_rfcomm_dlc *dlc);
48
57 void (*disconnected)(struct bt_rfcomm_dlc *dlc);
58
64 void (*recv)(struct bt_rfcomm_dlc *dlc, struct net_buf *buf);
65
72 void (*sent)(struct bt_rfcomm_dlc *dlc, struct net_buf *buf, int err);
73};
74
77typedef enum bt_rfcomm_role {
81
84 /* Response Timeout eXpired (RTX) timer */
86
87 /* Queue for outgoing data */
89
90 /* TX credits, Reuse as a binary sem for MSC FC if CFC is not enabled */
91 struct k_sem tx_credits;
92
93 struct bt_rfcomm_session *session;
95 struct bt_rfcomm_dlc *_next;
96
99
104
105 /* Stack & kernel data for TX thread */
108};
109
113
124 int (*accept)(struct bt_conn *conn, struct bt_rfcomm_dlc **dlc);
125
126 struct bt_rfcomm_server *_next;
127};
128
140
153int bt_rfcomm_dlc_connect(struct bt_conn *conn, struct bt_rfcomm_dlc *dlc,
155
166int bt_rfcomm_dlc_send(struct bt_rfcomm_dlc *dlc, struct net_buf *buf);
167
178
187
188#ifdef __cplusplus
189}
190#endif
191
196#endif /* ZEPHYR_INCLUDE_BLUETOOTH_RFCOMM_H_ */
Bluetooth data buffer API.
Bluetooth connection handling.
bt_security_t
Security level.
Definition: conn.h:352
enum bt_rfcomm_role bt_rfcomm_role_t
Role of RFCOMM session and dlc.
int bt_rfcomm_dlc_connect(struct bt_conn *conn, struct bt_rfcomm_dlc *dlc, uint8_t channel)
Connect RFCOMM channel.
int bt_rfcomm_dlc_send(struct bt_rfcomm_dlc *dlc, struct net_buf *buf)
Send data to RFCOMM.
int bt_rfcomm_dlc_disconnect(struct bt_rfcomm_dlc *dlc)
Disconnect RFCOMM dlc.
bt_rfcomm_role
Role of RFCOMM session and dlc.
Definition: rfcomm.h:77
struct net_buf * bt_rfcomm_create_pdu(struct net_buf_pool *pool)
Allocate the buffer from pool after reserving head room for RFCOMM, L2CAP and ACL headers.
int bt_rfcomm_server_register(struct bt_rfcomm_server *server)
Register RFCOMM server.
@ BT_RFCOMM_ROLE_INITIATOR
Definition: rfcomm.h:79
@ BT_RFCOMM_ROLE_ACCEPTOR
Definition: rfcomm.h:78
@ BT_RFCOMM_CHAN_SPP
Definition: rfcomm.h:33
@ BT_RFCOMM_CHAN_HFP_HF
Definition: rfcomm.h:29
@ BT_RFCOMM_CHAN_HSP_HS
Definition: rfcomm.h:32
@ BT_RFCOMM_CHAN_HFP_AG
Definition: rfcomm.h:30
@ BT_RFCOMM_CHAN_HSP_AG
Definition: rfcomm.h:31
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
RFCOMM DLC operations structure.
Definition: rfcomm.h:39
void(* sent)(struct bt_rfcomm_dlc *dlc, struct net_buf *buf, int err)
DLC sent callback.
Definition: rfcomm.h:72
void(* recv)(struct bt_rfcomm_dlc *dlc, struct net_buf *buf)
DLC recv callback.
Definition: rfcomm.h:64
void(* disconnected)(struct bt_rfcomm_dlc *dlc)
DLC disconnected callback.
Definition: rfcomm.h:57
void(* connected)(struct bt_rfcomm_dlc *dlc)
DLC connected callback.
Definition: rfcomm.h:47
RFCOMM DLC structure.
Definition: rfcomm.h:83
struct bt_rfcomm_dlc_ops * ops
Definition: rfcomm.h:94
struct k_fifo tx_queue
Definition: rfcomm.h:88
uint8_t dlci
Definition: rfcomm.h:101
uint16_t mtu
Definition: rfcomm.h:100
struct k_sem tx_credits
Definition: rfcomm.h:91
struct k_work_delayable rtx_work
Definition: rfcomm.h:85
bt_rfcomm_role_t role
Definition: rfcomm.h:98
bt_security_t required_sec_level
Definition: rfcomm.h:97
uint8_t state
Definition: rfcomm.h:102
uint8_t rx_credit
Definition: rfcomm.h:103
K_KERNEL_STACK_MEMBER(stack, 256)
struct k_thread tx_thread
Definition: rfcomm.h:106
struct bt_rfcomm_session * session
Definition: rfcomm.h:93
Definition: rfcomm.h:110
uint8_t channel
Server Channel.
Definition: rfcomm.h:112
int(* accept)(struct bt_conn *conn, struct bt_rfcomm_dlc **dlc)
Server accept callback.
Definition: rfcomm.h:124
Definition: kernel.h:2376
Thread Structure.
Definition: thread.h:250
A structure used to submit work after a delay.
Definition: kernel.h:3891
Network buffer pool representation.
Definition: buf.h:1070
Network buffer representation.
Definition: buf.h:1004