avrcp: allow to pass NULL as connection cid output parameter

This commit is contained in:
Matthias Ringwald 2018-06-26 12:24:07 +02:00
parent dba24ced98
commit dd5e598191
3 changed files with 11 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;