diff --git a/src/classic/avrcp.c b/src/classic/avrcp.c index 4e1dbf624..3e722551a 100644 --- a/src/classic/avrcp.c +++ b/src/classic/avrcp.c @@ -674,9 +674,10 @@ uint8_t avrcp_connect(bd_addr_t bd_addr, avrcp_context_t * context, uint16_t * a return BTSTACK_MEMORY_ALLOC_FAILED; } - if (!avrcp_cid) return L2CAP_LOCAL_CID_DOES_NOT_EXIST; - - *avrcp_cid = connection->avrcp_cid; + if (avrcp_cid){ + *avrcp_cid = connection->avrcp_cid; + } + connection->state = AVCTP_CONNECTION_W4_SDP_QUERY_COMPLETE; context->avrcp_l2cap_psm = 0; diff --git a/src/classic/avrcp_browsing_controller.c b/src/classic/avrcp_browsing_controller.c index ed2bc41c2..09ba54e1d 100644 --- a/src/classic/avrcp_browsing_controller.c +++ b/src/classic/avrcp_browsing_controller.c @@ -155,9 +155,10 @@ static uint8_t avrcp_browsing_connect(bd_addr_t remote_addr, avrcp_context_t * c return BTSTACK_MEMORY_ALLOC_FAILED; } - if (!browsing_cid) return L2CAP_LOCAL_CID_DOES_NOT_EXIST; - - *browsing_cid = avrcp_connection->avrcp_browsing_cid; + if (browsing_cid){ + *browsing_cid = avrcp_connection->avrcp_browsing_cid; + } + connection->ertm_buffer = ertm_buffer; connection->ertm_buffer_size = size; avrcp_connection->browsing_connection = connection; diff --git a/src/classic/avrcp_browsing_target.c b/src/classic/avrcp_browsing_target.c index fd1db9496..039e38875 100644 --- a/src/classic/avrcp_browsing_target.c +++ b/src/classic/avrcp_browsing_target.c @@ -226,9 +226,10 @@ static uint8_t avrcp_browsing_connect(bd_addr_t remote_addr, avrcp_context_t * c return BTSTACK_MEMORY_ALLOC_FAILED; } - if (!browsing_cid) return L2CAP_LOCAL_CID_DOES_NOT_EXIST; + if (browsing_cid){ + *browsing_cid = avrcp_connection->avrcp_browsing_cid; + } - *browsing_cid = avrcp_connection->avrcp_browsing_cid; connection->ertm_buffer = ertm_buffer; connection->ertm_buffer_size = size; avrcp_connection->browsing_connection = connection;