3.3.0.0R11
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
wiced_bt_rfcomm.h File Reference

Typedefs

typedef void( wiced_bt_port_event_cback_t )(wiced_bt_rfcomm_port_event_t event, uint16_t port_handle)
 
typedef void( wiced_bt_port_mgmt_cback_t )(wiced_bt_rfcomm_result_t code, uint16_t port_handle)
 
typedef int( wiced_bt_rfcomm_data_cback_t )(uint16_t port_handle, void *p_data, uint16_t len)
 
typedef enum
wiced_bt_rfcomm_port_event_e 
wiced_bt_rfcomm_port_event_t
 
typedef int wiced_bt_rfcomm_result_t
 
typedef uint8_t wiced_bt_rfcomm_signal_t
 

Enumerations

enum  wiced_bt_rfcomm_port_event_e {
  PORT_EV_RXCHAR = 0x00000001, PORT_EV_RXFLAG = 0x00000002, PORT_EV_TXEMPTY = 0x00000004, PORT_EV_CTS = 0x00000008,
  PORT_EV_DSR = 0x00000010, PORT_EV_RLSD = 0x00000020, PORT_EV_BREAK = 0x00000040, PORT_EV_ERR = 0x00000080,
  PORT_EV_RING = 0x00000100, PORT_EV_CTSS = 0x00000400, PORT_EV_DSRS = 0x00000800, PORT_EV_RLSDS = 0x00001000,
  PORT_EV_OVERRUN = 0x00002000, PORT_EV_TXCHAR = 0x00004000, PORT_EV_CONNECTED = 0x00000200, PORT_EV_CONNECT_ERR = 0x00008000,
  PORT_EV_FC = 0x00010000, PORT_EV_FCS = 0x00020000
}
 
enum  wiced_bt_rfcomm_result_e {
  WICED_BT_RFCOMM_SUCCESS, WICED_BT_RFCOMM_ERROR, WICED_BT_RFCOMM_ALREADY_OPENED, WICED_BT_RFCOMM_CMD_PENDING,
  WICED_BT_RFCOMM_APP_NOT_REGISTERED, WICED_BT_RFCOMM_NO_MEM, WICED_BT_RFCOMM_NO_RESOURCES, WICED_BT_RFCOMM_BAD_BD_ADDR,
  WICED_BT_RFCOMM_INVALID_MTU, WICED_BT_RFCOMM_BAD_HANDLE, WICED_BT_RFCOMM_NOT_OPENED, WICED_BT_RFCOMM_LINE_ERR,
  WICED_BT_RFCOMM_START_FAILED , WICED_BT_RFCOMM_PEER_CONNECTION_FAILED, WICED_BT_RFCOMM_PEER_FAILED, WICED_BT_RFCOMM_PEER_TIMEOUT,
  WICED_BT_RFCOMM_CLOSED , WICED_BT_RFCOMM_LOCAL_CLOSED, WICED_BT_RFCOMM_LOCAL_TIMEOUT , WICED_BT_RFCOMM_PAGE_TIMEOUT,
  WICED_BT_RFCOMM_INVALID_SCN
}
 
enum  wiced_bt_rfcomm_signal_e { ,
  PORT_CLR_DTRDSR, PORT_SET_CTSRTS, PORT_CLR_CTSRTS, PORT_SET_RI,
  PORT_CLR_RI, PORT_SET_DCD, PORT_CLR_DCD, PORT_BREAK
}
 

Functions

wiced_bt_rfcomm_result_t wiced_bt_rfcomm_check_connection (UINT16 handle, BD_ADDR bd_addr, UINT16 *p_lcid)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_control (uint16_t handle, uint8_t signal)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_create_connection (uint16_t uuid, uint8_t scn, wiced_bool_t is_server, uint16_t mtu, wiced_bt_device_address_t bd_addr, uint16_t *p_handle, wiced_bt_port_mgmt_cback_t *p_mgmt_cb)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_flow_control (uint16_t handle, wiced_bool_t enable)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_remove_connection (uint16_t handle, wiced_bool_t remove_server)
 
wiced_bt_dev_status_t wiced_bt_rfcomm_set_buffer_pool (uint16_t buffer_size, uint16_t buffer_count)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_set_data_callback (uint16_t port_handle, wiced_bt_rfcomm_data_cback_t *p_cb)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_set_event_callback (uint16_t port_handle, wiced_bt_port_event_cback_t *p_port_cb)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_set_event_mask (uint16_t port_handle, wiced_bt_rfcomm_port_event_t mask)
 
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_write_data (uint16_t handle, char *p_data, uint16_t max_len, uint16_t *p_len)
 

Detailed Description

Bluetooth RFCOMM Application Programming Interface

Typedef Documentation

typedef void( wiced_bt_port_event_cback_t)(wiced_bt_rfcomm_port_event_t event, uint16_t port_handle)

Port event callback

Parameters
event: A 32-bit event code that contains a bit-mask of one or more events the caller would like to register.
port_handle: Port handle from wiced_bt_rfcomm_create_connection .
typedef void( wiced_bt_port_mgmt_cback_t)(wiced_bt_rfcomm_result_t code, uint16_t port_handle)

Port management callback

Parameters
code: Result code
port_handle: Port handle from wiced_bt_rfcomm_create_connection .
typedef int( wiced_bt_rfcomm_data_cback_t)(uint16_t port_handle, void *p_data, uint16_t len)

Define the callback function prototypes for wiced_bt_rfcomm_data_cback_t

Parameters
port_handle: A 16-bit unsigned integer returned by wiced_bt_rfcomm_create_connection .
*p_data: A pointer to the array of bytes received from the peer device.
len: The length of the data received.

RFCOMM Port Event Masks

RFCOMM result code (see wiced_bt_rfcomm_result_e)

typedef uint8_t wiced_bt_rfcomm_signal_t

RFCOMM Signals (see wiced_bt_rfcomm_signal_e)

Enumeration Type Documentation

RFCOMM Port Event Masks

Enumerator
PORT_EV_RXCHAR 

Any Character received

PORT_EV_RXFLAG 

Received certain character

PORT_EV_TXEMPTY 

Transmitt Queue Empty

PORT_EV_CTS 

CTS changed state

PORT_EV_DSR 

DSR changed state

PORT_EV_RLSD 

RLSD changed state

PORT_EV_BREAK 

BREAK received

PORT_EV_ERR 

Line status error occurred

PORT_EV_RING 

Ring signal detected

PORT_EV_CTSS 

CTS state

PORT_EV_DSRS 

DSR state

PORT_EV_RLSDS 

RLSD state

PORT_EV_OVERRUN 

receiver buffer overrun

PORT_EV_TXCHAR 

Any character transmitted

PORT_EV_CONNECTED 

RFCOMM connection established

PORT_EV_CONNECT_ERR 

Was not able to establish connection or disconnected

PORT_EV_FC 

data flow enabled flag changed by remote

PORT_EV_FCS 

data flow enable status true = enabled

RFCOMM Result Codes

Enumerator
WICED_BT_RFCOMM_SUCCESS 

Success

WICED_BT_RFCOMM_ERROR 

Error

WICED_BT_RFCOMM_ALREADY_OPENED 

Already Opened

WICED_BT_RFCOMM_CMD_PENDING 

Command Pending

WICED_BT_RFCOMM_APP_NOT_REGISTERED 

App Not Registered

WICED_BT_RFCOMM_NO_MEM 

No Memory

WICED_BT_RFCOMM_NO_RESOURCES 

No Resources

WICED_BT_RFCOMM_BAD_BD_ADDR 

Bad BD Address

WICED_BT_RFCOMM_INVALID_MTU 

Invalid MTU

WICED_BT_RFCOMM_BAD_HANDLE 

Bad Handle

WICED_BT_RFCOMM_NOT_OPENED 

Not Opened

WICED_BT_RFCOMM_LINE_ERR 

Line Error

WICED_BT_RFCOMM_START_FAILED 

Start Failed

WICED_BT_RFCOMM_PEER_CONNECTION_FAILED 

Peer Connection Failed

WICED_BT_RFCOMM_PEER_FAILED 

Peer Failed

WICED_BT_RFCOMM_PEER_TIMEOUT 

Peer Timeout

WICED_BT_RFCOMM_CLOSED 

Closed

WICED_BT_RFCOMM_LOCAL_CLOSED 

Local Closed

WICED_BT_RFCOMM_LOCAL_TIMEOUT 

Local Timeout

WICED_BT_RFCOMM_PAGE_TIMEOUT 

Page Timeout

WICED_BT_RFCOMM_INVALID_SCN 

Invalid SCN

RFCOMM Signals

Enumerator
PORT_CLR_DTRDSR 

DTRDSR set

PORT_SET_CTSRTS 

DTRDSR clear

PORT_CLR_CTSRTS 

CTSRTS set

PORT_SET_RI 

CTSRTS clear

PORT_CLR_RI 

RI set (DCE only)

PORT_SET_DCD 

RI clear (DCE only)

PORT_CLR_DCD 

DCD set (DCE only)

PORT_BREAK 

DCD clear (DCE only)