Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
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
20#include <bluetooth/buf.h>
21#include <bluetooth/conn.h>
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
58
64 void (*recv)(struct bt_rfcomm_dlc *dlc, struct net_buf *buf);
65};
66
69typedef enum bt_rfcomm_role {
73
76 /* Response Timeout eXpired (RTX) timer */
78
79 /* Queue for outgoing data */
81
82 /* TX credits, Reuse as a binary sem for MSC FC if CFC is not enabled */
83 struct k_sem tx_credits;
84
85 struct bt_rfcomm_session *session;
87 struct bt_rfcomm_dlc *_next;
88
91
96
97 /* Stack & kernel data for TX thread */
100};
101
105
116 int (*accept)(struct bt_conn *conn, struct bt_rfcomm_dlc **dlc);
117
118 struct bt_rfcomm_server *_next;
119};
120
132
145int bt_rfcomm_dlc_connect(struct bt_conn *conn, struct bt_rfcomm_dlc *dlc,
147
158int bt_rfcomm_dlc_send(struct bt_rfcomm_dlc *dlc, struct net_buf *buf);
159
170
179
180#ifdef __cplusplus
181}
182#endif
183
188#endif /* ZEPHYR_INCLUDE_BLUETOOTH_RFCOMM_H_ */
Bluetooth data buffer API.
Bluetooth connection handling.
void
Definition: eswifi_shell.c:15
bt_security_t
Definition: conn.h:663
enum bt_rfcomm_role bt_rfcomm_role_t
Role of RFCOMM session and dlc. Used only by internal APIs.
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. Used only by internal APIs.
Definition: rfcomm.h:69
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_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
@ BT_RFCOMM_ROLE_INITIATOR
Definition: rfcomm.h:71
@ BT_RFCOMM_ROLE_ACCEPTOR
Definition: rfcomm.h:70
struct k_stack stack
Definition: test_stack_contexts.c:18
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
RFCOMM DLC operations structure.
Definition: rfcomm.h:39
void(* recv)(struct bt_rfcomm_dlc *dlc, struct net_buf *buf)
Definition: rfcomm.h:64
void(* disconnected)(struct bt_rfcomm_dlc *dlc)
Definition: rfcomm.h:57
void(* connected)(struct bt_rfcomm_dlc *dlc)
Definition: rfcomm.h:47
RFCOMM DLC structure.
Definition: rfcomm.h:75
struct bt_rfcomm_dlc_ops * ops
Definition: rfcomm.h:86
struct k_fifo tx_queue
Definition: rfcomm.h:80
uint8_t dlci
Definition: rfcomm.h:93
uint16_t mtu
Definition: rfcomm.h:92
struct k_sem tx_credits
Definition: rfcomm.h:83
struct k_work_delayable rtx_work
Definition: rfcomm.h:77
bt_rfcomm_role_t role
Definition: rfcomm.h:90
bt_security_t required_sec_level
Definition: rfcomm.h:89
uint8_t state
Definition: rfcomm.h:94
uint8_t rx_credit
Definition: rfcomm.h:95
K_KERNEL_STACK_MEMBER(stack, 256)
struct k_thread tx_thread
Definition: rfcomm.h:98
struct bt_rfcomm_session * session
Definition: rfcomm.h:85
Definition: rfcomm.h:102
uint8_t channel
Definition: rfcomm.h:104
int(* accept)(struct bt_conn *conn, struct bt_rfcomm_dlc **dlc)
Definition: rfcomm.h:116
Definition: kernel.h:2153
Definition: thread.h:201
A structure used to submit work after a delay.
Definition: kernel.h:3651
Network buffer pool representation.
Definition: buf.h:983
Network buffer representation.
Definition: buf.h:919