mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 12:35:25 +00:00
l2cap: improve header documentation
This commit is contained in:
parent
5fbd66f45c
commit
f2924d79ff
@ -205,12 +205,6 @@ int l2cap_can_send_packet_now(uint16_t local_cid){
|
||||
return hci_can_send_acl_packet_now(channel->handle);
|
||||
}
|
||||
|
||||
// @deprecated
|
||||
int l2cap_can_send_connectionless_packet_now(void){
|
||||
// TODO provide real handle
|
||||
return l2cap_can_send_fixed_channel_packet_now(0x1234);
|
||||
}
|
||||
|
||||
int l2cap_can_send_fixed_channel_packet_now(uint16_t handle){
|
||||
return hci_can_send_acl_packet_now(handle);
|
||||
}
|
||||
|
48
src/l2cap.h
48
src/l2cap.h
@ -162,14 +162,15 @@ typedef struct l2cap_signaling_response {
|
||||
} l2cap_signaling_response_t;
|
||||
|
||||
|
||||
// internal use
|
||||
int l2cap_can_send_fixed_channel_packet_now(uint16_t handle);
|
||||
void l2cap_register_fixed_channel(btstack_packet_handler_t packet_handler, uint16_t channel_id);
|
||||
int l2cap_send_connectionless(uint16_t handle, uint16_t cid, uint8_t *data, uint16_t len);
|
||||
int l2cap_send_prepared_connectionless(uint16_t handle, uint16_t cid, uint16_t len);
|
||||
|
||||
// @deprecated use l2cap_can_send_fixed_channel_packet_now instead
|
||||
int l2cap_can_send_connectionless_packet_now(void);
|
||||
|
||||
// PTS Testing
|
||||
int l2cap_send_echo_request(uint16_t handle, uint8_t *data, uint16_t len);
|
||||
|
||||
void l2cap_require_security_level_2_for_outgoing_sdp(void); // for PTS testing only
|
||||
void l2cap_require_security_level_2_for_outgoing_sdp(void);
|
||||
|
||||
/* API_START */
|
||||
|
||||
@ -183,6 +184,16 @@ void l2cap_init(void);
|
||||
*/
|
||||
void l2cap_register_packet_handler(void (*handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size));
|
||||
|
||||
/**
|
||||
* @brief Get max MTU for Classic connections based on btstack configuration
|
||||
*/
|
||||
uint16_t l2cap_max_mtu(void);
|
||||
|
||||
/**
|
||||
* @brief Get max MTU for LE connections based on btstack configuration
|
||||
*/
|
||||
uint16_t l2cap_max_le_mtu(void);
|
||||
|
||||
/**
|
||||
* @brief Creates L2CAP channel to the PSM of a remote device with baseband address. A new baseband connection will be initiated if necessary.
|
||||
* @param packet_handler
|
||||
@ -220,36 +231,39 @@ uint8_t l2cap_register_service(btstack_packet_handler_t packet_handler, uint16_t
|
||||
void l2cap_unregister_service(uint16_t psm);
|
||||
|
||||
/**
|
||||
* @brief Accepts/Deny incoming L2CAP connection.
|
||||
* @brief Accepts incoming L2CAP connection.
|
||||
*/
|
||||
void l2cap_accept_connection(uint16_t local_cid);
|
||||
|
||||
/**
|
||||
* @brief Deny incoming L2CAP connection.
|
||||
*/
|
||||
void l2cap_decline_connection(uint16_t local_cid, uint8_t reason);
|
||||
|
||||
/**
|
||||
* @brief Non-blocking UART write
|
||||
* @brief Check if outgoing buffer is available and that there's space on the Bluetooth module
|
||||
*/
|
||||
int l2cap_can_send_packet_now(uint16_t local_cid);
|
||||
|
||||
/**
|
||||
* @brief Reserve outgoing buffer
|
||||
*/
|
||||
int l2cap_reserve_packet_buffer(void);
|
||||
void l2cap_release_packet_buffer(void);
|
||||
|
||||
/**
|
||||
* @brief Get outgoing buffer and prepare data.
|
||||
*/
|
||||
uint8_t *l2cap_get_outgoing_buffer(void);
|
||||
|
||||
/**
|
||||
* @brief Send L2CAP packet prepared in outgoing buffer to channel
|
||||
*/
|
||||
int l2cap_send_prepared(uint16_t local_cid, uint16_t len);
|
||||
|
||||
int l2cap_send_prepared_connectionless(uint16_t handle, uint16_t cid, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief Bluetooth 4.0 - allows to register handler for Attribute Protocol and Security Manager Protocol.
|
||||
* @brief Release outgoing buffer (only needed if l2cap_send_prepared is not called)
|
||||
*/
|
||||
void l2cap_register_fixed_channel(btstack_packet_handler_t packet_handler, uint16_t channel_id);
|
||||
|
||||
uint16_t l2cap_max_mtu(void);
|
||||
uint16_t l2cap_max_le_mtu(void);
|
||||
|
||||
int l2cap_send_connectionless(uint16_t handle, uint16_t cid, uint8_t *data, uint16_t len);
|
||||
void l2cap_release_packet_buffer(void);
|
||||
|
||||
/* API_END */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user