diff --git a/example/spp_streamer.c b/example/spp_streamer.c index e94351a7f..a58dbfd2a 100644 --- a/example/spp_streamer.c +++ b/example/spp_streamer.c @@ -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 diff --git a/example/spp_streamer_client.c b/example/spp_streamer_client.c index bb4174185..cbd2f59bf 100644 --- a/example/spp_streamer_client.c +++ b/example/spp_streamer_client.c @@ -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 diff --git a/src/classic/rfcomm.c b/src/classic/rfcomm.c index daace2392..0b24631b8 100644 --- a/src/classic/rfcomm.c +++ b/src/classic/rfcomm.c @@ -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