l2cap: annotate API - prepared buffer can only be used for L2CAP Basic Mode

This commit is contained in:
Matthias Ringwald 2018-04-30 11:51:28 +02:00
parent 8bea14f288
commit 4e6fa3a2bb
2 changed files with 7 additions and 0 deletions

View File

@ -794,10 +794,12 @@ uint8_t *l2cap_get_outgoing_buffer(void){
return hci_get_outgoing_packet_buffer() + COMPLETE_L2CAP_HEADER; // 8 bytes return hci_get_outgoing_packet_buffer() + COMPLETE_L2CAP_HEADER; // 8 bytes
} }
// only for L2CAP Basic Channels
int l2cap_reserve_packet_buffer(void){ int l2cap_reserve_packet_buffer(void){
return hci_reserve_packet_buffer(); return hci_reserve_packet_buffer();
} }
// only for L2CAP Basic Channels
void l2cap_release_packet_buffer(void){ void l2cap_release_packet_buffer(void){
hci_release_packet_buffer(); hci_release_packet_buffer();
} }
@ -1097,6 +1099,7 @@ static int l2cap_send_signaling_packet(hci_con_handle_t handle, L2CAP_SIGNALING_
} }
// assumption - only on Classic connections // assumption - only on Classic connections
// cannot be used for L2CAP ERTM
int l2cap_send_prepared(uint16_t local_cid, uint16_t len){ int l2cap_send_prepared(uint16_t local_cid, uint16_t len){
if (!hci_is_packet_buffer_reserved()){ if (!hci_is_packet_buffer_reserved()){

View File

@ -523,21 +523,25 @@ void l2cap_request_can_send_now_event(uint16_t local_cid);
/** /**
* @brief Reserve outgoing buffer * @brief Reserve outgoing buffer
* @note Only for L2CAP Basic Mode Channels
*/ */
int l2cap_reserve_packet_buffer(void); int l2cap_reserve_packet_buffer(void);
/** /**
* @brief Get outgoing buffer and prepare data. * @brief Get outgoing buffer and prepare data.
* @note Only for L2CAP Basic Mode Channels
*/ */
uint8_t *l2cap_get_outgoing_buffer(void); uint8_t *l2cap_get_outgoing_buffer(void);
/** /**
* @brief Send L2CAP packet prepared in outgoing buffer to channel * @brief Send L2CAP packet prepared in outgoing buffer to channel
* @note Only for L2CAP Basic Mode Channels
*/ */
int l2cap_send_prepared(uint16_t local_cid, uint16_t len); int l2cap_send_prepared(uint16_t local_cid, uint16_t len);
/** /**
* @brief Release outgoing buffer (only needed if l2cap_send_prepared is not called) * @brief Release outgoing buffer (only needed if l2cap_send_prepared is not called)
* @note Only for L2CAP Basic Mode Channels
*/ */
void l2cap_release_packet_buffer(void); void l2cap_release_packet_buffer(void);