hci: configure Classic ACL packet types with hci_enable_acl_packet_types

This commit is contained in:
Matthias Ringwald 2023-11-23 11:23:11 +01:00
parent 67955da46a
commit 028ead5ee6
3 changed files with 18 additions and 1 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
### Added
- HCI: configure Classic ACL packet types with hci_enable_acl_packet_types
- GAP: generic GAP_SUBEVENT_LE_CONNECTION_COMPLETE
- L2CAP: additional authorization_required param in l2cap_ecbm_register_service
- GATT Client: support GATT over Enhanced LE Bearer

View File

@ -1361,8 +1361,13 @@ static uint16_t hci_acl_packet_types_for_buffer_size_and_local_features(uint16_t
}
uint16_t hci_usable_acl_packet_types(void){
uint16_t active_packet_types = (hci_stack->usable_packet_types_acl & hci_stack->enabled_packet_types_acl);
// flip bits for "may not be used"
return hci_stack->usable_packet_types_acl ^ 0x3306;
return active_packet_types ^ 0x3306;
}
void hci_enable_acl_packet_types(uint16_t packet_types){
hci_stack->enabled_packet_types_acl = packet_types;
}
static const struct {
@ -4812,6 +4817,8 @@ void hci_init(const hci_transport_t *transport, const void *config){
// Link Supervision Timeout
hci_stack->link_supervision_timeout = HCI_LINK_SUPERVISION_TIMEOUT_DEFAULT;
// All ACL packet types are enabledh
hci_stack->enabled_packet_types_acl = ACL_PACKET_TYPES_ALL;
#endif
// Secure Simple Pairing default: enable, no I/O capabilities, general bonding, mitm not required, auto accept

View File

@ -1136,6 +1136,9 @@ typedef struct {
// usable ACL packet types given HCI_ACL_BUFFER_SIZE and local supported features
uint16_t usable_packet_types_acl;
// enabled ACL packet types
uint16_t enabled_packet_types_acl;
// usable SCO packet types given local supported features
uint16_t usable_packet_types_sco;
@ -1615,6 +1618,12 @@ uint16_t hci_max_acl_data_packet_length(void);
*/
uint16_t hci_usable_acl_packet_types(void);
/**
* Set filter for set of ACL packet types returned by hci_usable_acl_packet_types
* @param packet_types see CL_PACKET_TYPES_* in bluetooth.h, default: ACL_PACKET_TYPES_ALL
*/
void hci_enable_acl_packet_types(uint16_t packet_types);
/**
* Get supported SCO packet types. Not flipped. Called by HFP
*/