diff --git a/CHANGELOG.md b/CHANGELOG.md index 74300ca9f..dd35ea986 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/hci.c b/src/hci.c index 46e64766b..80f102831 100644 --- a/src/hci.c +++ b/src/hci.c @@ -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 diff --git a/src/hci.h b/src/hci.h index c066dcff8..b0e14aab8 100644 --- a/src/hci.h +++ b/src/hci.h @@ -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 */