btnut/btnode/include/bt/bt_rfcomm.h File Reference


Detailed Description

Implementation of the RFCOMM protocol for BTNut. A subset of the ETSI TS 07.10 standard with some Bluetooth-specific adaptations.

Author:
Ole Reinhardt <ole.reinhardt@embedded-it.de>
Date:
25.01.2005
See Bluetooth 1.1 specification for better understanding of l2cap.

Some parts are taken from or inspired by the lwBT Bluetooth stack.

(lwBT author: Conny Ohult <conny@sm.luth.se>) Copyright (c) 2003 EISLAB, Lulea University of Technology.)

#include <bt/bt_hci_defs.h>

Data Structures

struct  bt_rfcomm_channel
struct  bt_rfcomm_l2cap_pkt_buf_entry
struct  bt_rfcomm_listen
struct  bt_rfcomm_stack

Defines

#define BT_RFCOMM_CFG_FC   0x02
#define BT_RFCOMM_CFG_INITIATOR   0x01
#define BT_RFCOMM_CFG_MSC_IN   0x08
#define BT_RFCOMM_CFG_MSC_OUT   0x04
#define BT_RFCOMM_CH_CFG   0x07
#define BT_RFCOMM_CH_CLOSED   0x01
#define BT_RFCOMM_CH_CONNECTED   0x04
#define BT_RFCOMM_CH_LISTEN   0x02
#define BT_RFCOMM_CH_OPEN   0x03
#define BT_RFCOMM_CH_W4_DISC_RSP   0x08
#define BT_RFCOMM_CH_W4_MULTIPLEXER   0x05
#define BT_RFCOMM_CH_W4_SABM_RSP   0x06
#define BT_RFCOMM_CHNR_INVALID   0xFF
#define BT_RFCOMM_CMD   0x01
#define BT_RFCOMM_CODE_WORD   0xE0
#define BT_RFCOMM_COM_BR_DEF   0x03
#define BT_RFCOMM_COM_CFG_DEF   0x03
#define BT_RFCOMM_COM_FC_DEF   0x00
#define BT_RFCOMM_COM_XOFF_DEF   0x00
#define BT_RFCOMM_COM_XON_DEF   0x00
#define BT_RFCOMM_CON_CB   void (*con_cb) (u_char dlci, u_char type, void *arg)
#define BT_RFCOMM_CONNECT   0x01
#define BT_RFCOMM_CRC_CHECK_LEN   3
#define BT_RFCOMM_CREDIT_CB   void (*credit_cb) (u_char dlci, u_char credits, void *arg)
#define BT_RFCOMM_DEF_CL   0x0F
#define BT_RFCOMM_DEF_CREDITS   0x07
#define BT_RFCOMM_DEF_MFS   (BT_L2CAP_MTU_DEFAULT - BT_RFCOMM_HDR_LEN_2 - BT_RFCOMM_FCS_LEN)
#define BT_RFCOMM_DEF_MTU   (u_short)(BT_RFCOMM_DEF_MFS + BT_RFCOMM_HDR_LEN_2 + BT_RFCOMM_FCS_LEN)
#define BT_RFCOMM_DEF_PRIO   0x07
#define BT_RFCOMM_DEF_TO   20000
#define BT_RFCOMM_DISC   0x53
#define BT_RFCOMM_DISC_LEN   4
#define BT_RFCOMM_DISCONNECT   0x02
#define BT_RFCOMM_DLCI2CH(dlci)   (dlci >> 1)
#define BT_RFCOMM_DLCI_INVALID   0xFF
#define BT_RFCOMM_DLCI_MUX   0x00
#define BT_RFCOMM_DM   0x0F
#define BT_RFCOMM_DM_LEN   4
#define BT_RFCOMM_DM_PF   0x1F
#define BT_RFCOMM_EMPTYMSG_LEN   0
#define BT_RFCOMM_ERR_CON_CLOSED   0x05
#define BT_RFCOMM_ERR_CON_REFUSED   0x06
#define BT_RFCOMM_ERR_DATASIZE   0x07
#define BT_RFCOMM_ERR_INVALID_CH   0x03
#define BT_RFCOMM_ERR_NO_RESSOURCE   0x01
#define BT_RFCOMM_ERR_OFFS_L2CAP   0x20
#define BT_RFCOMM_ERR_OOLCR   0x04
#define BT_RFCOMM_ERR_SESSION_EXISTS   0x08
#define BT_RFCOMM_ERR_SUCCESS   0x00
#define BT_RFCOMM_ERR_TIMEOUT   0x02
#define BT_RFCOMM_FCOFF_CMD   0x63
#define BT_RFCOMM_FCOFF_RSP   0x61
#define BT_RFCOMM_FCOFFMSG_LEN   0
#define BT_RFCOMM_FCON_CMD   0xA3
#define BT_RFCOMM_FCON_RSP   0xA1
#define BT_RFCOMM_FCONMSG_LEN   0
#define BT_RFCOMM_FCS_LEN   1
#define BT_RFCOMM_FRAME_I   0x02
#define BT_RFCOMM_FRAME_UI   0x01
#define BT_RFCOMM_FRAME_UIH   0x00
#define BT_RFCOMM_HDR_LEN_1   3
#define BT_RFCOMM_HDR_LEN_2   4
#define BT_RFCOMM_LINE_CB   void (*line_cb) (u_char dlci, u_char flags, void *arg)
#define BT_RFCOMM_MAX_CHANNELS   30
#define BT_RFCOMM_MSC_CMD   0xE3
#define BT_RFCOMM_MSC_RSP   0xE1
#define BT_RFCOMM_MSCMSG_LEN   2
#define BT_RFCOMM_MSGHDR_LEN   2
#define BT_RFCOMM_NO_TIMEOUT   0xFFFFFFFF
#define BT_RFCOMM_NSC_RSP   0x11
#define BT_RFCOMM_NSCMSG_LEN   1
#define BT_RFCOMM_PN_CMD   0x83
#define BT_RFCOMM_PN_RSP   0x81
#define BT_RFCOMM_PNMSG_LEN   8
#define BT_RFCOMM_RCV_CB   void (*rcv_cb) (u_char dlci, u_char *payload, u_short len, void *arg)
#define BT_RFCOMM_RLS_CMD   0x53
#define BT_RFCOMM_RLS_ERR_FRAMING   0x08
#define BT_RFCOMM_RLS_ERR_OVERRUN   0x02
#define BT_RFCOMM_RLS_ERR_PARITY   0x04
#define BT_RFCOMM_RLS_ERROR   0x01
#define BT_RFCOMM_RLS_RSP   0x51
#define BT_RFCOMM_RLSMSG_LEN   2
#define BT_RFCOMM_RPN_BAUD_115200   0x07
#define BT_RFCOMM_RPN_BAUD_19200   0x04
#define BT_RFCOMM_RPN_BAUD_230400   0x08
#define BT_RFCOMM_RPN_BAUD_2400   0x00
#define BT_RFCOMM_RPN_BAUD_38400   0x05
#define BT_RFCOMM_RPN_BAUD_4800   0x01
#define BT_RFCOMM_RPN_BAUD_57600   0x06
#define BT_RFCOMM_RPN_BAUD_7200   0x02
#define BT_RFCOMM_RPN_BAUD_9600   0x03
#define BT_RFCOMM_RPN_CMD   0x93
#define BT_RFCOMM_RPN_RSP   0x91
#define BT_RFCOMM_RPNMSG_LEN   8
#define BT_RFCOMM_RSP   0x00
#define BT_RFCOMM_SABM   0x3F
#define BT_RFCOMM_SABM_LEN   4
#define BT_RFCOMM_SIG_DEFAULT   (BT_RFCOMM_SIG_RTC | BT_RFCOMM_SIG_RTR | BT_RFCOMM_SIG_DV)
#define BT_RFCOMM_SIG_DV   0x80
#define BT_RFCOMM_SIG_FC   0x02
#define BT_RFCOMM_SIG_IC   0x40
#define BT_RFCOMM_SIG_RTC   0x04
#define BT_RFCOMM_SIG_RTR   0x08
#define BT_RFCOMM_TEST_CMD   0x23
#define BT_RFCOMM_TEST_RSP   0x21
#define BT_RFCOMM_UA   0x73
#define BT_RFCOMM_UA_LEN   4
#define BT_RFCOMM_UIH   0xEF
#define BT_RFCOMM_UIH_LEN   3
#define BT_RFCOMM_UIH_PF   0xFF
#define BT_RFCOMM_UIHCRC_CHECK_LEN   2
#define BT_RFCOMM_UIHCRED_LEN   4

Typedefs

typedef bt_rfcomm_channel bt_rfcomm_channel_t
typedef bt_rfcomm_l2cap_pkt_buf_entry bt_rfcomm_l2cap_pkt_buf_entry_t
typedef bt_rfcomm_listen bt_rfcomm_listen_t
typedef bt_rfcomm_stack bt_rfcomm_stack_t

Functions

u_char bt_rfcomm_connect (u_char channel_nr, BT_RFCOMM_CON_CB, BT_RFCOMM_RCV_CB, BT_RFCOMM_LINE_CB, BT_RFCOMM_CREDIT_CB, u_char credit_limit, void *cb_arg)
u_char bt_rfcomm_disconnect (u_char dlci)
bt_rfcomm_stack * bt_rfcomm_init (struct bt_l2cap_stack *l2cap_stack, u_short max_mfs, u_char nr_channels, u_char nr_l2cap_buffer)
u_char bt_rfcomm_listen (u_char channel_nr, BT_RFCOMM_CON_CB, BT_RFCOMM_RCV_CB, BT_RFCOMM_LINE_CB, BT_RFCOMM_CREDIT_CB, u_char credit_limit, void *cb_arg, u_long timeout)
u_char bt_rfcomm_send (u_char dlci, u_char *data, u_short length)
u_char bt_rfcomm_send_credits (u_char dlci, u_char credits)
u_char bt_rfcomm_start_session (bt_addr_t bt_addr, u_char page_scan_rep_mode, u_short clock_offset)
u_char bt_rfcomm_test (u_long timeout)


Generated on Wed Apr 29 11:12:29 2009 for BTnut System Software by doxygen 1.5.1