dotstack API Reference  1.10.37
Macros
RFCOMM Configuration

This module describes parameters used to configure RFCOMM layer. More...

Macros

#define RFCOMM_MAX_SESSIONS
 Maximum number of remote devices a local device can be connected to. More...
 
#define RFCOMM_MAX_DLCS
 Maximum number of DLCs. More...
 
#define RFCOMM_MAX_SERVER_CHANNELS
 Maximum number of Server channels. More...
 
#define RFCOMM_INFO_LEN   (HCI_L2CAP_BUFFER_LEN - RFCOMM_FRAME_HEADER_LEN - L2CAP_HEADER_LEN)
 Maximum size of the data portion of a UIH frame. More...
 
#define RFCOMM_MAX_CMD_BUFFERS
 Maximum number of command buffers. More...
 
#define RFCOMM_LOCAL_CREDIT
 The number of receive buffers. More...
 
#define RFCOMM_ENABLE_MULTIDEVICE_CHANNELS   BT_FALSE
 Enable multi-device server channels. More...
 

Detailed Description

This module describes parameters used to configure RFCOMM layer.

dotstack is customized using a configuration file. The configuration file tailors the dotstack to the application being built. It has to have the structure shown below.

#include "cdbt/bt/bt_std.h"
// HCI and L2CAP must always be present
// SDP is required only if stack is running in dual mode. This is the default mode.
// To run the stack in single mode (i.e. only BLE is supported) a BT_BLE_SINGLE_MODE symbol
// must be defined:
// #define BT_BLE_SINGLE_MODE
// HCI configuration parameters
#define HCI_MAX_CMD_BUFFERS ...
#define HCI_MAX_DATA_BUFFERS ...
#define HCI_MAX_ACL_CONNECTIONS ...
#define HCI_RX_BUFFER_LEN ...
#define HCI_TX_BUFFER_LEN ...
#define HCI_L2CAP_BUFFER_LEN ...
#define HCI_MAX_CMD_PARAM_LEN ...
// L2CAP configuration parameters
#define L2CAP_MAX_CMD_BUFFERS ...
#define L2CAP_MAX_FRAME_BUFFERS ...
#define L2CAP_MAX_PSMS ...
#define L2CAP_MAX_CHANNELS ...
// SDP configuration parameters
#define SDP_MAX_SEARCH_RESULT_LEN ...
#define SDP_MAX_ATTRIBUTE_RESULT_LEN ...
// Depending on protocols and profiles used below goes configuration parameters
// for each used module. E.g., to use and configure RFCOMM,
// the following values must be defined:
#define RFCOMM_MAX_SESSIONS ...
#define RFCOMM_MAX_DLCS ...
#define RFCOMM_MAX_SERVER_CHANNELS ...
#define RFCOMM_INFO_LEN ...
#define RFCOMM_MAX_DATA_BUFFERS ...
#define RFCOMM_MAX_CMD_BUFFERS ...
#define RFCOMM_LOCAL_CREDIT ...
#include "cdbt/bt/bt_oem_config.h"

Macro Definition Documentation

#define RFCOMM_ENABLE_MULTIDEVICE_CHANNELS   BT_FALSE

Enable multi-device server channels.

Normally each server channel can be used only once. I.e. if device A connected to channel 1, device B cannot connect to channel 1 until device A disconnects. With this option it is possible to make channels accept connections from several devices at the same time. I.e., if RFCOMM_ENABLE_MULTIDEVICE_CHANNELS is TRUE both device A and device B can connect to channel 1 at the same time.

#define RFCOMM_INFO_LEN   (HCI_L2CAP_BUFFER_LEN - RFCOMM_FRAME_HEADER_LEN - L2CAP_HEADER_LEN)

Maximum size of the data portion of a UIH frame.

This parameter defines the maximum size of the data portion of a UIH frame. If CFC is used the actual length of the data portion will be 1 byte less. This value must be less than or equal to HCI_L2CAP_BUFFER_LEN - RFCOMM_FRAME_HEADER_LEN - L2CAP_HEADER_LEN.

#define RFCOMM_LOCAL_CREDIT

The number of receive buffers.

This parameter defines the number of received UIH frames that can be stored on the local device. The flow control mechanism used in RFCOMM ensures that the remote side of the link always knows how many free buffers left on the local device. When the number of free buffers reaches 0, the transmitter stops sending data frames until the receiver frees some buffers. The RFCOMM layer does not actually allocate space for buffers. It uses RFCOMM_LOCAL_CREDIT to keep track of free buffers and report them to the remote side. Actual memory allocation is done in SPP layer.

#define RFCOMM_MAX_CMD_BUFFERS

Maximum number of command buffers.

This parameter defines the maximum number of commands that can be sent at the same time. It is usually enough to reserve 2 buffers for each DLC excluding control DLC. Therefore, this value can be defined as
#define RFCOMM_MAX_CMD_BUFFERS (RFCOMM_MAX_DLCS - 1) * 2

#define RFCOMM_MAX_DLCS

Maximum number of DLCs.

This parameter defines the maximum number of DLCs on each session. This value should be at least 2 because each session uses one DLC to convey multiplexer control messages. All other DLCs are used to emulate serial ports.

#define RFCOMM_MAX_SERVER_CHANNELS

Maximum number of Server channels.

This parameter defines the maximum number of server channels exposed by the local device. This value should not exceed RFCOMM_MAX_DLCS - 1.

#define RFCOMM_MAX_SESSIONS

Maximum number of remote devices a local device can be connected to.

This parameter defines the maximum number of remote devices a local device can have simultaneous connections to. This value should not exceed HCI_MAX_ACL_CONNECTIONS.