RFCOMM Functions.
More...
|
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) |
| Establish serial port connection to the peer device, or allow RFCOMM to accept a connection from peer devices. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_remove_connection (uint16_t handle, wiced_bool_t remove_server) |
| Close the specified connection. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_set_event_callback (uint16_t port_handle, wiced_bt_port_event_cback_t *p_port_cb) |
| Set event callback the specified connection. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_set_data_callback (uint16_t port_handle, wiced_bt_rfcomm_data_cback_t *p_cb) |
| Set event data callback the specified connection. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_set_event_mask (uint16_t port_handle, wiced_bt_rfcomm_port_event_t mask) |
| Set events for which to be notified. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_control (uint16_t handle, uint8_t signal) |
| Send control signal to the peer device. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_flow_control (uint16_t handle, wiced_bool_t enable) |
| This function directs a specified connection to pass flow control message to the peer device. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_write_data (uint16_t handle, char *p_data, uint16_t max_len, uint16_t *p_len) |
| This function directs a specified connection to pass flow control message to the peer device. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_check_connection (UINT16 handle, BD_ADDR bd_addr, UINT16 *p_lcid) |
| This function checks connection referenced by handle is up and running. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_init (uint32_t buffer_size, uint32_t buffer_cnt) |
| This function allocates private pool to be used by RFCOMM. More...
|
|
wiced_bool_t | wiced_bt_rfcomm_control_data_flow (BD_ADDR peer_bda) |
| This function enables flow control based on ACL buffer availability. More...
|
|
wiced_bt_rfcomm_result_t | wiced_bt_rfcomm_port_get_queue_status (uint16_t handle, wiced_port_status_t *p_status) |
| This function reports current status of a connection. More...
|
|
RFCOMM Functions.
This function checks connection referenced by handle is up and running.
- Parameters
-
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_LINE_ERR : If connection is not up and running
Note BD_Address must be in Big Endian format
Send control signal to the peer device.
- Parameters
-
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
wiced_bool_t wiced_bt_rfcomm_control_data_flow |
( |
BD_ADDR |
peer_bda | ) |
|
This function enables flow control based on ACL buffer availability.
- Parameters
-
[in] | peer_addr | : Peer BD Address |
- Returns
- WICED_TRUE : If successful WICED_FALSE : If fails
Establish serial port connection to the peer device, or allow RFCOMM to accept a connection from peer devices.
- Note
- Server can call this function with the same scn parameter multiple times if it is ready to accept multiple simulteneous connections.
DLCI for the connection is (scn * 2 + 1) if client originates connection on existing none initiator multiplexer channel. Otherwise it is (scn * 2). For the server DLCI can be changed later if client will be calling it using (scn * 2 + 1) dlci.
- Parameters
-
[in] | uuid | : The Universal Unique Identifier (UUID) of the Class ID of the service being opened |
[in] | scn | : The Service Channel Number(SCN) as registered with the SDP (server) or obtained using SDP from the peer device (client) |
[in] | is_server | : TRUE if requesting application is a server |
[in] | mtu | : The maximum number of bytes transferred per frame If 0, a default size of L2CAP_MTU_SIZE minus 5 bytes is used |
[in] | bd_addr | : BD_ADDR of the peer (if client), NULL if server |
[in] | p_mgmt_cb | : Pointer to callback function to receive connection up/down events |
[out] | p_handle | : A pointer to the handle set by RFCOMM to be used in consecutive calls for this connection |
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_ALREADY_OPENED : If the client tries to establish a connection to the same BD_ADDR WICED_BT_RFCOMM_NO_RESOURCES : If there is not enough memory to allocate a control block structure
Note BD_Address must be in Big Endian format
This function directs a specified connection to pass flow control message to the peer device.
Enable flag passed shows if port can accept more data.
- Parameters
-
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
This function allocates private pool to be used by RFCOMM.
- Parameters
-
[in] | buffer_size | : size of buffer |
[out] | buffer_cnt | : buffers |
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_ERROR : If pool allocation fails
This function reports current status of a connection.
- Parameters
-
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
Close the specified connection.
- Parameters
-
[in] | handle | : The connection handle returned by wiced_bt_rfcomm_create_connection . |
[in] | remove_server | : (for server only) If TRUE, then also remove server; otherwise server remains enabled after connection is closed. |
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
Set event data callback the specified connection.
- Parameters
-
[in] | port_handle | : A 16-bit unsigned integer returned by wiced_bt_rfcomm_create_connection |
[in] | p_cb | : Address of the callback function which should be called from the RFCOMM when a data packet is received |
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
Set event callback the specified connection.
- Parameters
-
[in] | port_handle | : A 16-bit unsigned integer returned by wiced_bt_rfcomm_create_connection |
[in] | p_port_cb | : Address of the callback function which should be called from the RFCOMM when an event specified in the mask occurs |
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
Set events for which to be notified.
- Parameters
-
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened
wiced_bt_rfcomm_result_t wiced_bt_rfcomm_write_data |
( |
uint16_t |
handle, |
|
|
char * |
p_data, |
|
|
uint16_t |
max_len, |
|
|
uint16_t * |
p_len |
|
) |
| |
This function directs a specified connection to pass flow control message to the peer device.
Enable flag passed shows if port can accept more data.
- Parameters
-
- Returns
- WICED_BT_RFCOMM_SUCCESS : If successful WICED_BT_RFCOMM_BAD_HANDLE : If the handle is out of range WICED_BT_RFCOMM_NOT_OPENED : If the connection is not opened