btstack_defines: add events for enhanced credit-based flow control mode

# Conflicts:
#	src/btstack_defines.h
#	src/btstack_event.h
This commit is contained in:
Matthias Ringwald 2021-08-17 20:23:10 +02:00
parent 396f0845e5
commit e644fcbc21
2 changed files with 283 additions and 0 deletions

View File

@ -906,6 +906,65 @@ typedef uint8_t sm_key_t[16];
*/
#define L2CAP_EVENT_TRIGGER_RUN 0x7f
/**
* @format 1BH212
* @param address_type
* @param address
* @param handle
* @param psm
* @param num_channels
* @param local_cid first new cid
*/
#define L2CAP_EVENT_DATA_CHANNEL_INCOMING 0x8A
/**
* @format 11BH122222
* @param status
* @param address_type
* @param address
* @param handle
* @param incoming
* @param psm
* @param local_cid
* @param remote_cid
* @param local_mtu
* @param remote_mtu
*/
#define L2CAP_EVENT_DATA_CHANNEL_OPENED 0x8b
/*
* @format 2
* @param local_cid
*/
#define L2CAP_EVENT_DATA_CHANNEL_CLOSED 0x8c
/*
* @format 2
* @param local_cid
*/
#define L2CAP_EVENT_DATA_CHANNEL_CAN_SEND_NOW 0x8d
/*
* @format 2
* @param local_cid
*/
#define L2CAP_EVENT_DATA_CHANNEL_PACKET_SENT 0x8e
/*
* @format 222
* @param remote_cid
* @param mtu
* @param mps
*/
#define L2CAP_EVENT_DATA_CHANNEL_RECONFIGURED 0x8f
/*
* @format 22
* @param local_cid
* @param reconfigure_result
*/
#define L2CAP_EVENT_DATA_CHANNEL_RECONFIGURATION_COMPLETE 0x96
/*
* @format H22
* @param con_handle
@ -914,6 +973,7 @@ typedef uint8_t sm_key_t[16];
*/
#define L2CAP_EVENT_INFORMATION_RESPONSE 0x97
// RFCOMM EVENTS
/**

View File

@ -1619,6 +1619,229 @@ static inline uint16_t l2cap_event_ertm_buffer_released_get_local_cid(const uint
}
/**
* @brief Get field address_type from event L2CAP_EVENT_DATA_CHANNEL_INCOMING
* @param event packet
* @return address_type
* @note: btstack_type 1
*/
static inline uint8_t l2cap_event_data_channel_incoming_get_address_type(const uint8_t * event){
return event[2];
}
/**
* @brief Get field address from event L2CAP_EVENT_DATA_CHANNEL_INCOMING
* @param event packet
* @param Pointer to storage for address
* @note: btstack_type B
*/
static inline void l2cap_event_data_channel_incoming_get_address(const uint8_t * event, bd_addr_t address){
reverse_bytes(&event[3], address, 6);
}
/**
* @brief Get field handle from event L2CAP_EVENT_DATA_CHANNEL_INCOMING
* @param event packet
* @return handle
* @note: btstack_type H
*/
static inline hci_con_handle_t l2cap_event_data_channel_incoming_get_handle(const uint8_t * event){
return little_endian_read_16(event, 9);
}
/**
* @brief Get field psm from event L2CAP_EVENT_DATA_CHANNEL_INCOMING
* @param event packet
* @return psm
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_incoming_get_psm(const uint8_t * event){
return little_endian_read_16(event, 11);
}
/**
* @brief Get field num_channels from event L2CAP_EVENT_DATA_CHANNEL_INCOMING
* @param event packet
* @return num_channels
* @note: btstack_type 1
*/
static inline uint8_t l2cap_event_data_channel_incoming_get_num_channels(const uint8_t * event){
return event[13];
}
/**
* @brief Get field local_cid from event L2CAP_EVENT_DATA_CHANNEL_INCOMING
* @param event packet
* @return local_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_incoming_get_local_cid(const uint8_t * event){
return little_endian_read_16(event, 14);
}
/**
* @brief Get field status from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return status
* @note: btstack_type 1
*/
static inline uint8_t l2cap_event_data_channel_opened_get_status(const uint8_t * event){
return event[2];
}
/**
* @brief Get field address_type from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return address_type
* @note: btstack_type 1
*/
static inline uint8_t l2cap_event_data_channel_opened_get_address_type(const uint8_t * event){
return event[3];
}
/**
* @brief Get field address from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @param Pointer to storage for address
* @note: btstack_type B
*/
static inline void l2cap_event_data_channel_opened_get_address(const uint8_t * event, bd_addr_t address){
reverse_bytes(&event[4], address, 6);
}
/**
* @brief Get field handle from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return handle
* @note: btstack_type H
*/
static inline hci_con_handle_t l2cap_event_data_channel_opened_get_handle(const uint8_t * event){
return little_endian_read_16(event, 10);
}
/**
* @brief Get field incoming from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return incoming
* @note: btstack_type 1
*/
static inline uint8_t l2cap_event_data_channel_opened_get_incoming(const uint8_t * event){
return event[12];
}
/**
* @brief Get field psm from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return psm
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_opened_get_psm(const uint8_t * event){
return little_endian_read_16(event, 13);
}
/**
* @brief Get field local_cid from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return local_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_opened_get_local_cid(const uint8_t * event){
return little_endian_read_16(event, 15);
}
/**
* @brief Get field remote_cid from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return remote_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_opened_get_remote_cid(const uint8_t * event){
return little_endian_read_16(event, 17);
}
/**
* @brief Get field local_mtu from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return local_mtu
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_opened_get_local_mtu(const uint8_t * event){
return little_endian_read_16(event, 19);
}
/**
* @brief Get field remote_mtu from event L2CAP_EVENT_DATA_CHANNEL_OPENED
* @param event packet
* @return remote_mtu
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_opened_get_remote_mtu(const uint8_t * event){
return little_endian_read_16(event, 21);
}
/**
* @brief Get field local_cid from event L2CAP_EVENT_DATA_CHANNEL_CLOSED
* @param event packet
* @return local_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_closed_get_local_cid(const uint8_t * event){
return little_endian_read_16(event, 2);
}
/**
* @brief Get field local_cid from event L2CAP_EVENT_DATA_CHANNEL_CAN_SEND_NOW
* @param event packet
* @return local_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_can_send_now_get_local_cid(const uint8_t * event){
return little_endian_read_16(event, 2);
}
/**
* @brief Get field local_cid from event L2CAP_EVENT_DATA_CHANNEL_PACKET_SENT
* @param event packet
* @return local_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_packet_sent_get_local_cid(const uint8_t * event){
return little_endian_read_16(event, 2);
}
/**
* @brief Get field remote_cid from event L2CAP_EVENT_DATA_CHANNEL_RECONFIGURED
* @param event packet
* @return remote_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_reconfigured_get_remote_cid(const uint8_t * event){
return little_endian_read_16(event, 2);
}
/**
* @brief Get field mtu from event L2CAP_EVENT_DATA_CHANNEL_RECONFIGURED
* @param event packet
* @return mtu
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_reconfigured_get_mtu(const uint8_t * event){
return little_endian_read_16(event, 4);
}
/**
* @brief Get field mps from event L2CAP_EVENT_DATA_CHANNEL_RECONFIGURED
* @param event packet
* @return mps
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_reconfigured_get_mps(const uint8_t * event){
return little_endian_read_16(event, 6);
}
/**
* @brief Get field local_cid from event L2CAP_EVENT_DATA_CHANNEL_RECONFIGURATION_COMPLETE
* @param event packet
* @return local_cid
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_reconfiguration_complete_get_local_cid(const uint8_t * event){
return little_endian_read_16(event, 2);
}
/**
* @brief Get field reconfigure_result from event L2CAP_EVENT_DATA_CHANNEL_RECONFIGURATION_COMPLETE
* @param event packet
* @return reconfigure_result
* @note: btstack_type 2
*/
static inline uint16_t l2cap_event_data_channel_reconfiguration_complete_get_reconfigure_result(const uint8_t * event){
return little_endian_read_16(event, 4);
}
/**
* @brief Get field con_handle from event L2CAP_EVENT_INFORMATION_RESPONSE
* @param event packet