diff --git a/CHANGELOG.md b/CHANGELOG.md index d7376d85d..a2d446185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - L2CAP: provide status instead of undocumented int error code and bool for API functions - L2CAP: remote features not required for SDP connections - L2CAP: replaced l2cap_register_packet_handler with l2cap_add_event_handler to register multiple handlers +- L2CAP: use official terminology for L2CAP channel modes - ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE replaces ENABLE_LE_DATA_CHANNELS - RFCOMM: `RFCOMM_EVENT_PORT_CONFIGURATION` contains rfcomm_cid and remote flag, emitted for query config - RFCOMM: provide status instead of undocumented int error code and bool for API functions - RFCOMM: remote port configuration, line status, and modem status are sent by channel state machine diff --git a/doc/manual/docs-template/how_to.md b/doc/manual/docs-template/how_to.md index 1948909f8..849947e48 100644 --- a/doc/manual/docs-template/how_to.md +++ b/doc/manual/docs-template/how_to.md @@ -92,12 +92,12 @@ ENABLE_LE_SECURE_CONNECTIONS | Enable LE Secure Connections ENABLE_LE_PROACTIVE_AUTHENTICATION | Enable automatic encryption for bonded devices on re-connect ENABLE_GATT_CLIENT_PAIRING | Enable GATT Client to start pairing and retry operation on security error ENABLE_MICRO_ECC_FOR_LE_SECURE_CONNECTIONS | Use [micro-ecc library](https://github.com/kmackay/micro-ecc) for ECC operations -ENABLE_LE_DATA_CHANNELS | Enable LE Data Channels in credit-based flow control mode ENABLE_LE_DATA_LENGTH_EXTENSION | Enable LE Data Length Extension support ENABLE_LE_SIGNED_WRITE | Enable LE Signed Writes in ATT/GATT ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION | Enable address resolution for resolvable private addresses in Controller ENABLE_CROSS_TRANSPORT_KEY_DERIVATION | Enable Cross-Transport Key Derivation (CTKD) for Secure Connections -ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE | Enable L2CAP Enhanced Retransmission Mode. Mandatory for AVRCP Browsing +ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE | Enable Enhanced Retransmission Mode for L2CAP Channels. Mandatory for AVRCP Browsing +ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE | Enable LE credit-based flow-control mode for L2CAP channels ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL | Enable HCI Controller to Host Flow Control, see below ENABLE_ATT_DELAYED_RESPONSE | Enable support for delayed ATT operations, see [GATT Server](profiles/#sec:GATTServerProfile) ENABLE_BCM_PCM_WBS | Enable support for Wide-Band Speech codec in BCM controller, requires ENABLE_SCO_OVER_PCM diff --git a/port/apollo2-em9304/btstack_config.h b/port/apollo2-em9304/btstack_config.h index 25af0f072..574ca1cd1 100644 --- a/port/apollo2-em9304/btstack_config.h +++ b/port/apollo2-em9304/btstack_config.h @@ -11,7 +11,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LOG_ERROR diff --git a/port/archive/pic32-harmony/src/btstack_config.h b/port/archive/pic32-harmony/src/btstack_config.h index a1cc4b028..6bbee54e0 100644 --- a/port/archive/pic32-harmony/src/btstack_config.h +++ b/port/archive/pic32-harmony/src/btstack_config.h @@ -12,7 +12,7 @@ #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR diff --git a/port/archive/posix-h5-bcm/btstack_config.h b/port/archive/posix-h5-bcm/btstack_config.h index 2737d05e7..966b576b8 100644 --- a/port/archive/posix-h5-bcm/btstack_config.h +++ b/port/archive/posix-h5-bcm/btstack_config.h @@ -20,7 +20,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/archive/wiced-h5/btstack_config.h b/port/archive/wiced-h5/btstack_config.h index 3dbfa037f..3e231c9bc 100644 --- a/port/archive/wiced-h5/btstack_config.h +++ b/port/archive/wiced-h5/btstack_config.h @@ -15,7 +15,7 @@ #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/esp32/components/btstack/include/btstack_config.h b/port/esp32/components/btstack/include/btstack_config.h index 16764cb79..2f84129d4 100644 --- a/port/esp32/components/btstack/include/btstack_config.h +++ b/port/esp32/components/btstack/include/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/libusb-intel/btstack_config.h b/port/libusb-intel/btstack_config.h index 752996341..e2006f0e8 100644 --- a/port/libusb-intel/btstack_config.h +++ b/port/libusb-intel/btstack_config.h @@ -18,7 +18,7 @@ #define ENABLE_CLASSIC #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/libusb/btstack_config.h b/port/libusb/btstack_config.h index addf584e4..bfc8511c8 100644 --- a/port/libusb/btstack_config.h +++ b/port/libusb/btstack_config.h @@ -20,7 +20,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/max32630-fthr/src/btstack_config.h b/port/max32630-fthr/src/btstack_config.h index 93b7a849e..c61fb6537 100644 --- a/port/max32630-fthr/src/btstack_config.h +++ b/port/max32630-fthr/src/btstack_config.h @@ -14,7 +14,7 @@ #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LOG_ERROR diff --git a/port/msp432p401lp-cc256x/btstack_config.h b/port/msp432p401lp-cc256x/btstack_config.h index 1a981e986..01c54bb8f 100644 --- a/port/msp432p401lp-cc256x/btstack_config.h +++ b/port/msp432p401lp-cc256x/btstack_config.h @@ -15,7 +15,7 @@ #define ENABLE_CLASSIC #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO #define ENABLE_PRINTF_HEXDUMP diff --git a/port/nrf5-zephyr/btstack_config.h b/port/nrf5-zephyr/btstack_config.h index c3180cd01..19f3dccd1 100644 --- a/port/nrf5-zephyr/btstack_config.h +++ b/port/nrf5-zephyr/btstack_config.h @@ -10,7 +10,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LOG_ERROR diff --git a/port/posix-h4-atwilc3000/btstack_config.h b/port/posix-h4-atwilc3000/btstack_config.h index c03e21e03..296fa2dab 100644 --- a/port/posix-h4-atwilc3000/btstack_config.h +++ b/port/posix-h4-atwilc3000/btstack_config.h @@ -15,7 +15,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/posix-h4-da14581/btstack_config.h b/port/posix-h4-da14581/btstack_config.h index c03e21e03..296fa2dab 100644 --- a/port/posix-h4-da14581/btstack_config.h +++ b/port/posix-h4-da14581/btstack_config.h @@ -15,7 +15,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/posix-h4-da14585/btstack_config.h b/port/posix-h4-da14585/btstack_config.h index 4bff94ed0..4917bbfad 100644 --- a/port/posix-h4-da14585/btstack_config.h +++ b/port/posix-h4-da14585/btstack_config.h @@ -15,7 +15,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/posix-h4-zephyr/btstack_config.h b/port/posix-h4-zephyr/btstack_config.h index c7d381318..e19c82ec8 100644 --- a/port/posix-h4-zephyr/btstack_config.h +++ b/port/posix-h4-zephyr/btstack_config.h @@ -16,7 +16,7 @@ #define ENABLE_BLE #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/posix-h4/btstack_config.h b/port/posix-h4/btstack_config.h index d53b08638..417853284 100644 --- a/port/posix-h4/btstack_config.h +++ b/port/posix-h4/btstack_config.h @@ -21,7 +21,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/posix-h5/btstack_config.h b/port/posix-h5/btstack_config.h index 66f2938ab..443e23e45 100644 --- a/port/posix-h5/btstack_config.h +++ b/port/posix-h5/btstack_config.h @@ -19,7 +19,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/qt-h4/btstack_config.h b/port/qt-h4/btstack_config.h index 0820416f0..ae8951cfa 100644 --- a/port/qt-h4/btstack_config.h +++ b/port/qt-h4/btstack_config.h @@ -20,7 +20,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/qt-usb/btstack_config.h b/port/qt-usb/btstack_config.h index 0820416f0..ae8951cfa 100644 --- a/port/qt-usb/btstack_config.h +++ b/port/qt-usb/btstack_config.h @@ -20,7 +20,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/raspi/btstack_config.h b/port/raspi/btstack_config.h index 5407475e2..a55c62469 100644 --- a/port/raspi/btstack_config.h +++ b/port/raspi/btstack_config.h @@ -18,7 +18,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/renesas-tb-s1ja-cc256x/template/btstack_example/src/btstack_config.h b/port/renesas-tb-s1ja-cc256x/template/btstack_example/src/btstack_config.h index ced7b56bd..551dca0f5 100644 --- a/port/renesas-tb-s1ja-cc256x/template/btstack_example/src/btstack_config.h +++ b/port/renesas-tb-s1ja-cc256x/template/btstack_example/src/btstack_config.h @@ -15,7 +15,7 @@ #define ENABLE_CLASSIC #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LOG_ERROR #define ENABLE_PRINTF_HEXDUMP diff --git a/port/samv71-xplained-atwilc3000/btstack_config.h b/port/samv71-xplained-atwilc3000/btstack_config.h index db63adce2..ccaa36a7f 100644 --- a/port/samv71-xplained-atwilc3000/btstack_config.h +++ b/port/samv71-xplained-atwilc3000/btstack_config.h @@ -12,7 +12,7 @@ #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LOG_ERROR #define ENABLE_LOG_INFO diff --git a/port/stm32-f4discovery-cc256x/port/btstack_config.h b/port/stm32-f4discovery-cc256x/port/btstack_config.h index 967ec4666..a4534b3ab 100644 --- a/port/stm32-f4discovery-cc256x/port/btstack_config.h +++ b/port/stm32-f4discovery-cc256x/port/btstack_config.h @@ -16,7 +16,7 @@ #define ENABLE_CLASSIC #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LOG_ERROR #define ENABLE_PRINTF_HEXDUMP diff --git a/port/stm32-f4discovery-usb/port/btstack_config.h b/port/stm32-f4discovery-usb/port/btstack_config.h index 2fc61cce2..5ec761c4b 100644 --- a/port/stm32-f4discovery-usb/port/btstack_config.h +++ b/port/stm32-f4discovery-usb/port/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_CLASSIC #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LOG_INFO #define ENABLE_LOG_ERROR diff --git a/port/wiced-h4/btstack_config.h b/port/wiced-h4/btstack_config.h index b02a82746..c6f969863 100644 --- a/port/wiced-h4/btstack_config.h +++ b/port/wiced-h4/btstack_config.h @@ -14,7 +14,7 @@ #define ENABLE_BLE #define ENABLE_CLASSIC #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/windows-h4-da14585/btstack_config.h b/port/windows-h4-da14585/btstack_config.h index 72f203cc6..00ea11134 100644 --- a/port/windows-h4-da14585/btstack_config.h +++ b/port/windows-h4-da14585/btstack_config.h @@ -15,7 +15,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/windows-h4-zephyr/btstack_config.h b/port/windows-h4-zephyr/btstack_config.h index f6006367c..5848f66b6 100644 --- a/port/windows-h4-zephyr/btstack_config.h +++ b/port/windows-h4-zephyr/btstack_config.h @@ -15,7 +15,7 @@ // BTstack features that can be enabled #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/windows-h4/btstack_config.h b/port/windows-h4/btstack_config.h index 714fbf87c..8c4606044 100644 --- a/port/windows-h4/btstack_config.h +++ b/port/windows-h4/btstack_config.h @@ -19,7 +19,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/port/windows-winusb-intel/btstack_config.h b/port/windows-winusb-intel/btstack_config.h index da6486e58..238cbabee 100644 --- a/port/windows-winusb-intel/btstack_config.h +++ b/port/windows-winusb-intel/btstack_config.h @@ -18,7 +18,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/port/windows-winusb/btstack_config.h b/port/windows-winusb/btstack_config.h index c3dc89751..710b49073 100644 --- a/port/windows-winusb/btstack_config.h +++ b/port/windows-winusb/btstack_config.h @@ -19,7 +19,7 @@ #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/src/l2cap.c b/src/l2cap.c index dbb391dd0..82f1df331 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -52,7 +52,7 @@ #include "btstack_event.h" #include "btstack_memory.h" -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE // TODO avoid dependency on higher layer: used to trigger pairing for outgoing connections #include "ble/sm.h" #endif @@ -131,7 +131,13 @@ typedef enum { #define L2CAP_SIGNALING_COMMAND_LENGTH_OFFSET 2 #define L2CAP_SIGNALING_COMMAND_DATA_OFFSET 4 -#if defined(ENABLE_LE_DATA_CHANNELS) || defined(ENABLE_L2CAP_ENHANCED_DATA_CHANNELS) +#ifdef ENABLE_LE_DATA_CHANNELS +#warning "ENABLE_LE_DATA_CHANNELS has been deprecated." +#warning "Please use ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE instead in btstack_config.h" +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE +#endif + +#if defined(ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE) || defined(ENABLE_L2CAP_ENHANCED_DATA_CHANNELS) #define ENABLE_L2CAP_CREDIT_BASED_CHANNELS #endif @@ -159,7 +165,7 @@ static void l2cap_emit_channel_closed(l2cap_channel_t *channel); static void l2cap_emit_incoming_connection(l2cap_channel_t *channel); static int l2cap_channel_ready_for_open(l2cap_channel_t *channel); #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE static void l2cap_emit_le_channel_opened(l2cap_channel_t *channel, uint8_t status); static void l2cap_emit_le_channel_closed(l2cap_channel_t * channel); static void l2cap_emit_le_incoming_connection(l2cap_channel_t *channel); @@ -207,7 +213,7 @@ static uint8_t l2cap_require_security_level2_for_outgoing_sdp; static bd_addr_t l2cap_outgoing_classic_addr; #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE static btstack_linked_list_t l2cap_le_services; #endif @@ -956,7 +962,7 @@ void l2cap_deinit(void){ (void)memset(&l2cap_fixed_channel_att, 0, sizeof(l2cap_fixed_channel_att)); (void)memset(&l2cap_fixed_channel_sm, 0, sizeof(l2cap_fixed_channel_sm)); #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE l2cap_le_services = NULL; #endif #ifdef ENABLE_L2CAP_ENHANCED_DATA_CHANNELS @@ -1906,7 +1912,7 @@ static bool l2ap_run_information_requests(void){ } #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE static void l2cap_run_le_data_channels(void){ btstack_linked_list_iterator_t it; btstack_linked_list_iterator_init(&it, &l2cap_channels); @@ -2180,7 +2186,7 @@ static void l2cap_run(void){ } #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE l2cap_run_le_data_channels(); #endif @@ -2517,7 +2523,7 @@ static bool l2cap_channel_ready_to_send(l2cap_channel_t * channel){ case L2CAP_CHANNEL_TYPE_FIXED: if (!channel->waiting_for_can_send_now) return false; return hci_can_send_acl_le_packet_now() != 0; -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE case L2CAP_CHANNEL_TYPE_LE_DATA_CHANNEL: if (channel->state != L2CAP_STATE_OPEN) return false; if (channel->send_sdu_buffer == NULL) return false; @@ -2565,7 +2571,7 @@ static void l2cap_channel_trigger_send(l2cap_channel_t * channel){ l2cap_emit_can_send_now(channel->packet_handler, channel->local_cid); break; #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE case L2CAP_CHANNEL_TYPE_LE_DATA_CHANNEL: l2cap_credit_based_send_pdu(channel); break; @@ -2661,7 +2667,7 @@ static void l2cap_handle_hci_disconnect_event(l2cap_channel_t * channel){ } #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE static void l2cap_handle_hci_le_disconnect_event(l2cap_channel_t * channel){ if (l2cap_send_open_failed_on_hci_disconnect(channel)){ l2cap_emit_le_channel_opened(channel, L2CAP_CONNECTION_BASEBAND_DISCONNECT); @@ -2794,7 +2800,7 @@ static void l2cap_handle_disconnection_complete(hci_con_handle_t handle){ l2cap_handle_hci_disconnect_event(channel); break; #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE case L2CAP_CHANNEL_TYPE_LE_DATA_CHANNEL: l2cap_handle_hci_le_disconnect_event(channel); break; @@ -3994,7 +4000,7 @@ static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t l2cap_channel_t * channel; btstack_linked_list_iterator_t it; #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE uint16_t local_cid; uint16_t le_psm; l2cap_service_t * service; @@ -4066,7 +4072,7 @@ static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t if (!l2cap_is_dynamic_channel_type(channel->channel_type)) continue; if (channel->con_handle != handle) continue; if (channel->local_sig_id != sig_id) continue; -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE // if received while waiting for le connection response, assume legacy device if (channel->state == L2CAP_STATE_WAIT_LE_CONNECTION_RESPONSE){ channel->state = L2CAP_STATE_CLOSED; @@ -4096,7 +4102,7 @@ static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t break; #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE case LE_CREDIT_BASED_CONNECTION_REQUEST: // check size if (len < 10u) return 0u; @@ -4566,7 +4572,7 @@ static void l2cap_acl_le_handler(hci_con_handle_t handle, uint8_t *packet, uint1 l2cap_fixed_channel_t * l2cap_fixed_channel; -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE l2cap_channel_t * l2cap_channel; #endif uint16_t channel_id = READ_L2CAP_CHANNEL_ID(packet); @@ -4602,7 +4608,7 @@ static void l2cap_acl_le_handler(hci_con_handle_t handle, uint8_t *packet, uint1 default: -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE l2cap_channel = l2cap_get_channel_for_local_cid_and_handle(channel_id, handle); if (l2cap_channel != NULL) { l2cap_credit_based_handle_pdu(l2cap_channel, packet, size); @@ -4929,7 +4935,7 @@ static uint8_t l2cap_credit_based_disconnect(uint16_t local_cid){ } #endif -#ifdef ENABLE_LE_DATA_CHANNELS +#ifdef ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE static void l2cap_le_notify_channel_can_send(l2cap_channel_t *channel){ if (!channel->waiting_for_can_send_now) return; diff --git a/test/auto-pts/btstack_config.h b/test/auto-pts/btstack_config.h index b785b42d4..a3e0c8161 100644 --- a/test/auto-pts/btstack_config.h +++ b/test/auto-pts/btstack_config.h @@ -16,7 +16,7 @@ #define ENABLE_BLE #define ENABLE_BTP #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS #define ENABLE_LE_SIGNED_WRITE diff --git a/test/fuzz/btstack_config.h b/test/fuzz/btstack_config.h index d5f9356ae..b561a5ff6 100644 --- a/test/fuzz/btstack_config.h +++ b/test/fuzz/btstack_config.h @@ -19,7 +19,7 @@ #define ENABLE_CLASSIC #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/test/l2cap-le/btstack_config.h b/test/l2cap-le/btstack_config.h index 2643115f6..5234e0e33 100644 --- a/test/l2cap-le/btstack_config.h +++ b/test/l2cap-le/btstack_config.h @@ -21,7 +21,7 @@ #define ENABLE_LE_CENTRAL #define ENABLE_LE_PERIPHERAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_L2CAP_ENHANCED_DATA_CHANNELS // for ready-to-use hci channels diff --git a/test/map_client/btstack_config.h b/test/map_client/btstack_config.h index 0a0e6fd05..e79a21c0a 100644 --- a/test/map_client/btstack_config.h +++ b/test/map_client/btstack_config.h @@ -17,7 +17,7 @@ #define ENABLE_CLASSIC #define ENABLE_HFP_WIDE_BAND_SPEECH #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS diff --git a/test/pts/btstack_config.h b/test/pts/btstack_config.h index b023292a0..04731dca7 100644 --- a/test/pts/btstack_config.h +++ b/test/pts/btstack_config.h @@ -23,7 +23,7 @@ #define ENABLE_GOEP_L2CAP #define ENABLE_GATT_OVER_CLASSIC #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/test/security_manager_sc/btstack_config.h b/test/security_manager_sc/btstack_config.h index ba5395c81..d7e195ef6 100644 --- a/test/security_manager_sc/btstack_config.h +++ b/test/security_manager_sc/btstack_config.h @@ -14,7 +14,7 @@ #define ENABLE_ATT_DELAYED_RESPONSE #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_PRIVACY_ADDRESS_RESOLUTION diff --git a/tool/metrics/btstack_config.h b/tool/metrics/btstack_config.h index dba429256..465fd0654 100644 --- a/tool/metrics/btstack_config.h +++ b/tool/metrics/btstack_config.h @@ -12,7 +12,7 @@ #define ENABLE_ATT_DELAYED_RESPONSE #define ENABLE_BLE #define ENABLE_LE_CENTRAL -#define ENABLE_LE_DATA_CHANNELS +#define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE #define ENABLE_LE_DATA_LENGTH_EXTENSION #define ENABLE_LE_PERIPHERAL #define ENABLE_LE_SECURE_CONNECTIONS