rfcomm: assertt ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE is defined if ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM is enabled

This commit is contained in:
Matthias Ringwald 2019-01-09 09:25:54 +01:00
parent 8cef84f359
commit 278494d6b3
3 changed files with 12 additions and 6 deletions

View File

@ -86,7 +86,7 @@ static uint16_t rfcomm_cid = 0;
* RFCOMM can make use for ERTM. Due to the need to re-transmit packets,
* a large buffer is needed to still get high throughput
*/
#if defined(ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE) && defined (ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM)
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
static uint8_t ertm_buffer[20000];
static l2cap_ertm_config_t ertm_config = {
0, // ertm mandatory
@ -287,7 +287,7 @@ int btstack_main(int argc, const char * argv[])
rfcomm_init();
rfcomm_register_service(packet_handler, RFCOMM_SERVER_CHANNEL, 0xffff);
#if defined(ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE) && defined (ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM)
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
// setup ERTM management
rfcomm_enable_l2cap_ertm(&rfcomm_ertm_request_handler, &rfcomm_ertm_released_handler);
#endif

View File

@ -86,7 +86,7 @@ static uint16_t rfcomm_cid = 0;
* RFCOMM can make use for ERTM. Due to the need to re-transmit packets,
* a large buffer is needed to still get high throughput
*/
#if defined(ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE) && defined (ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM)
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
static uint8_t ertm_buffer[20000];
static l2cap_ertm_config_t ertm_config = {
0, // ertm mandatory
@ -301,7 +301,7 @@ int btstack_main(int argc, const char * argv[]){
rfcomm_init();
rfcomm_register_service(packet_handler, RFCOMM_SERVER_CHANNEL, 0xffff);
#if defined(ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE) && defined (ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM)
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
// setup ERTM management
rfcomm_enable_l2cap_ertm(&rfcomm_ertm_request_handler, &rfcomm_ertm_released_handler);
#endif

View File

@ -67,10 +67,16 @@
#endif
#endif
// L2CAP ERTM requires ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE and ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
#if defined(ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE) && defined(ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM)
// ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM requires ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
#define RFCOMM_USE_OUTGOING_BUFFER
#define RFCOMM_USE_ERTM
#else
#error "ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM requires ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE. "
#error "Please disable ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE_FOR_RFCOMM, or, "
#error "enable ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE"
#endif
#endif
#define RFCOMM_MULIPLEXER_TIMEOUT_MS 60000