Data Structures | |
struct | rfcomm_channel_t |
struct | rfcomm_multiplexer_t |
struct | rfcomm_rpn_data |
struct | rfcomm_service_t |
Macros | |
#define | RFCOMM_RLS_STATUS_INVALID 0xff |
#define | RFCOMM_TEST_DATA_MAX_LEN 4 |
#define | UNLIMITED_INCOMING_CREDITS 0xff |
Typedefs | |
typedef struct rfcomm_rpn_data | rfcomm_rpn_data_t |
Functions | |
void | rfcomm_accept_connection (uint16_t rfcomm_cid) |
Accepts incoming RFCOMM connection. More... | |
int | rfcomm_can_send_packet_now (uint16_t rfcomm_cid) |
Checks if RFCOMM can send packet. More... | |
uint8_t | rfcomm_create_channel (btstack_packet_handler_t packet_handler, bd_addr_t addr, uint8_t server_channel, uint16_t *out_cid) |
uint8_t | rfcomm_create_channel_with_initial_credits (btstack_packet_handler_t packet_handler, bd_addr_t addr, uint8_t server_channel, uint8_t initial_credits, uint16_t *out_cid) |
void | rfcomm_decline_connection (uint16_t rfcomm_cid) |
Deny incoming RFCOMM connection. More... | |
void | rfcomm_disconnect (uint16_t rfcomm_cid) |
Disconnects RFCOMM channel with given identifier. More... | |
uint16_t | rfcomm_get_max_frame_size (uint16_t rfcomm_cid) |
Query max frame size. More... | |
uint8_t * | rfcomm_get_outgoing_buffer (void) |
void | rfcomm_grant_credits (uint16_t rfcomm_cid, uint8_t credits) |
Grant more incoming credits to the remote side for the given RFCOMM channel identifier. More... | |
void | rfcomm_init (void) |
Set up RFCOMM. More... | |
int | rfcomm_query_port_configuration (uint16_t rfcomm_cid) |
Query remote port. More... | |
uint8_t | rfcomm_register_service (btstack_packet_handler_t packet_handler, uint8_t channel, uint16_t max_frame_size) |
Registers RFCOMM service for a server channel and a maximum frame size, and assigns a packet handler. More... | |
uint8_t | rfcomm_register_service_with_initial_credits (btstack_packet_handler_t packet_handler, uint8_t channel, uint16_t max_frame_size, uint8_t initial_credits) |
Registers RFCOMM service for a server channel and a maximum frame size, and assigns a packet handler. More... | |
void | rfcomm_release_packet_buffer (void) |
void | rfcomm_request_can_send_now_event (uint16_t rfcomm_cid) |
Request emission of RFCOMM_EVENT_CAN_SEND_NOW as soon as possible. More... | |
int | rfcomm_reserve_packet_buffer (void) |
Allow to create RFCOMM packet in outgoing buffer. More... | |
int | rfcomm_send (uint16_t rfcomm_cid, uint8_t *data, uint16_t len) |
Sends RFCOMM data packet to the RFCOMM channel with given identifier. More... | |
int | rfcomm_send_local_line_status (uint16_t rfcomm_cid, uint8_t line_status) |
Sends Local Line Status, see LINE_STATUS_. More... | |
int | rfcomm_send_modem_status (uint16_t rfcomm_cid, uint8_t modem_status) |
Send local modem status. More... | |
int | rfcomm_send_port_configuration (uint16_t rfcomm_cid, rpn_baud_t baud_rate, rpn_data_bits_t data_bits, rpn_stop_bits_t stop_bits, rpn_parity_t parity, rpn_flow_control_t flow_control) |
Configure remote port. More... | |
int | rfcomm_send_prepared (uint16_t rfcomm_cid, uint16_t len) |
void | rfcomm_set_required_security_level (gap_security_level_t security_level) |
Set security level required for incoming connections, need to be called before registering services. More... | |
void | rfcomm_unregister_service (uint8_t service_channel) |
Unregister RFCOMM service. More... | |
#define RFCOMM_RLS_STATUS_INVALID 0xff |
#define RFCOMM_TEST_DATA_MAX_LEN 4 |
#define UNLIMITED_INCOMING_CREDITS 0xff |
typedef struct rfcomm_rpn_data rfcomm_rpn_data_t |
enum RFCOMM_CHANNEL_STATE |
void rfcomm_accept_connection | ( | uint16_t | rfcomm_cid | ) |
Accepts incoming RFCOMM connection.
int rfcomm_can_send_packet_now | ( | uint16_t | rfcomm_cid | ) |
Checks if RFCOMM can send packet.
rfcomm_cid |
uint8_t rfcomm_create_channel | ( | btstack_packet_handler_t | packet_handler, |
bd_addr_t | addr, | ||
uint8_t | server_channel, | ||
uint16_t * | out_cid | ||
) |
uint8_t rfcomm_create_channel_with_initial_credits | ( | btstack_packet_handler_t | packet_handler, |
bd_addr_t | addr, | ||
uint8_t | server_channel, | ||
uint8_t | initial_credits, | ||
uint16_t * | out_cid | ||
) |
void rfcomm_decline_connection | ( | uint16_t | rfcomm_cid | ) |
Deny incoming RFCOMM connection.
void rfcomm_disconnect | ( | uint16_t | rfcomm_cid | ) |
Disconnects RFCOMM channel with given identifier.
uint16_t rfcomm_get_max_frame_size | ( | uint16_t | rfcomm_cid | ) |
Query max frame size.
rfcomm_cid |
uint8_t* rfcomm_get_outgoing_buffer | ( | void | ) |
void rfcomm_grant_credits | ( | uint16_t | rfcomm_cid, |
uint8_t | credits | ||
) |
Grant more incoming credits to the remote side for the given RFCOMM channel identifier.
void rfcomm_init | ( | void | ) |
Set up RFCOMM.
int rfcomm_query_port_configuration | ( | uint16_t | rfcomm_cid | ) |
Query remote port.
rfcomm_cid |
uint8_t rfcomm_register_service | ( | btstack_packet_handler_t | packet_handler, |
uint8_t | channel, | ||
uint16_t | max_frame_size | ||
) |
Registers RFCOMM service for a server channel and a maximum frame size, and assigns a packet handler.
This channel provides credits automatically to the remote side -> no flow control
packet | handler for all channels of this service |
channel | |
max_frame_size |
uint8_t rfcomm_register_service_with_initial_credits | ( | btstack_packet_handler_t | packet_handler, |
uint8_t | channel, | ||
uint16_t | max_frame_size, | ||
uint8_t | initial_credits | ||
) |
Registers RFCOMM service for a server channel and a maximum frame size, and assigns a packet handler.
This channel will use explicit credit management. During channel establishment, an initial amount of credits is provided.
packet | handler for all channels of this service |
channel | |
max_frame_size | |
initial_credits |
void rfcomm_release_packet_buffer | ( | void | ) |
void rfcomm_request_can_send_now_event | ( | uint16_t | rfcomm_cid | ) |
Request emission of RFCOMM_EVENT_CAN_SEND_NOW as soon as possible.
rfcomm_cid |
int rfcomm_reserve_packet_buffer | ( | void | ) |
Allow to create RFCOMM packet in outgoing buffer.
if (rfcomm_can_send_packet_now(cid)){ rfcomm_reserve_packet_buffer(); uint8_t * buffer = rfcomm_get_outgoing_buffer(); uint16_t buffer_size = rfcomm_get_max_frame_size(cid); // .. setup data in buffer with len rfcomm_send_prepared(cid, len) }
int rfcomm_send | ( | uint16_t | rfcomm_cid, |
uint8_t * | data, | ||
uint16_t | len | ||
) |
Sends RFCOMM data packet to the RFCOMM channel with given identifier.
rfcomm_cid |
int rfcomm_send_local_line_status | ( | uint16_t | rfcomm_cid, |
uint8_t | line_status | ||
) |
Sends Local Line Status, see LINE_STATUS_.
rfcomm_cid | |
line_status |
int rfcomm_send_modem_status | ( | uint16_t | rfcomm_cid, |
uint8_t | modem_status | ||
) |
Send local modem status.
see MODEM_STAUS_..
rfcomm_cid | |
modem_status |
int rfcomm_send_port_configuration | ( | uint16_t | rfcomm_cid, |
rpn_baud_t | baud_rate, | ||
rpn_data_bits_t | data_bits, | ||
rpn_stop_bits_t | stop_bits, | ||
rpn_parity_t | parity, | ||
rpn_flow_control_t | flow_control | ||
) |
Configure remote port.
rfcomm_cid | |
baud_rate | |
data_bits | |
stop_bits | |
parity | |
flow_control |
int rfcomm_send_prepared | ( | uint16_t | rfcomm_cid, |
uint16_t | len | ||
) |
void rfcomm_set_required_security_level | ( | gap_security_level_t | security_level | ) |
Set security level required for incoming connections, need to be called before registering services.
void rfcomm_unregister_service | ( | uint8_t | service_channel | ) |
Unregister RFCOMM service.