static void a2dp_msg_media_open_cfm(const A2DP_MEDIA_OPEN_CFM_T *message)
{
a2dpInstance *inst = a2dp_get_instance_from_device_id(message->device_id);
if (inst == NULL)
{
A2DP_MSG_DEBUG((" inst not found\n"));
return;
}
A2DP_MSG_DEBUG_INST(inst);
switch (a2dp_get_state(inst))
{
case A2DP_STATE_CONNECTING_MEDIA_LOCAL:
case A2DP_STATE_CONNECTING_MEDIA_REMOTE:
{
if (message->status == a2dp_success)
{
a2dp_codec_settings *settings = NULL;
/* store the device_id for this signalling connection */
inst->a2dp_stream_id = message->stream_id;
A2DP_MSG_DEBUG((" device ID:[0x%x]\n", message->device_id));
A2DP_MSG_DEBUG((" stream ID [0x%x]\n", message->stream_id));
settings = A2dpCodecGetSettings(message->device_id, message->stream_id);
if (settings)
{
A2DP_MSG_DEBUG((" stream end point ID [0x%x]\n", settings->seid));/*位置在这里*/
/* update the audio plugin in use */
audio_a2dp_set_plugin(settings->seid);
/* free the settings memory that the A2DP library allocated */
memory_free(settings);
}
/* update the state to reflect the media channel is connected */
a2dp_set_state(inst, A2DP_STATE_CONNECTED_MEDIA);
}
else
{
/* if media can't be connected then disconnect signalling channel */
a2dp_set_state(inst, A2DP_STATE_DISCONNECTING);
}
}
break;
default:
{
a2dp_msg_unhandled_state(inst);
}
break;
}
}