acp close stream

This commit is contained in:
Milanka Ringwald 2016-12-08 12:17:12 +01:00
parent f93ebdf2d6
commit 2a2ef299e2
2 changed files with 14 additions and 14 deletions

View File

@ -372,6 +372,7 @@ int avdtp_acceptor_stream_config_subsm_run(avdtp_connection_t * connection, avdt
avdtp_acceptor_send_accept_response(stream_endpoint->connection->l2cap_signaling_cid, AVDTP_SI_OPEN, stream_endpoint->connection->acceptor_transaction_label);
break;
case AVDTP_ACCEPTOR_W2_ANSWER_START_STREAM:
printf(" ACP: DONE \n");
printf(" ACP: AVDTP_STREAM_ENDPOINT_STREAMING \n");
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_STREAMING;
avdtp_acceptor_send_accept_response(stream_endpoint->connection->l2cap_signaling_cid, AVDTP_SI_START, stream_endpoint->connection->acceptor_transaction_label);
@ -390,9 +391,6 @@ int avdtp_acceptor_stream_config_subsm_run(avdtp_connection_t * connection, avdt
case AVDTP_ACCEPTOR_W2_ANSWER_CLOSE_STREAM:
printf(" ACP: DONE\n");
// stream_endpoint->state = AVDTP_STREAM_ENDPOINT_OPENED;
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_IDLE;
printf(" ACP: AVDTP_STREAM_ENDPOINT_OPENED\n");
avdtp_acceptor_send_accept_response(stream_endpoint->connection->l2cap_signaling_cid, AVDTP_SI_CLOSE, connection->acceptor_transaction_label);
break;

View File

@ -716,20 +716,22 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
if (!stream_endpoint) return;
if (stream_endpoint->l2cap_media_cid == local_cid){
// printf(" -> L2CAP_EVENT_CHANNEL_CLOSED media cid 0x%0x, stream endpoint %p, connection %p", local_cid, stream_endpoint, stream_endpoint->connection);
stream_endpoint->l2cap_media_cid = 0;
if (stream_endpoint->state == AVDTP_STREAM_ENDPOINT_CLOSING){
if (stream_endpoint->connection){
// stream_endpoint->acceptor_config_state = AVDTP_ACCEPTOR_W2_ANSWER_CLOSED;
// avdtp_sink_request_can_send_now_acceptor(stream_endpoint->connection, stream_endpoint->connection->l2cap_signaling_cid);
switch (stream_endpoint->state){
case AVDTP_STREAM_ENDPOINT_CLOSING:
if (stream_endpoint->connection){
printf(" -> AVDTP_STREAM_ENDPOINT_OPENED\n");
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_OPENED;
break;
}
printf(" -> AVDTP_STREAM_ENDPOINT_IDLE\n");
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_IDLE;
break;
default:
printf(" -> AVDTP_STREAM_ENDPOINT_IDLE\n");
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_IDLE;
break;
} else {
printf(" closing media channel, no signaling connection registered\n");
}
break;
}
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_CONFIGURED;
break;
}
if (stream_endpoint->l2cap_recovery_cid == local_cid){