void A2dpSetSepInUse(device_sep_list *sep_list, uint8 seid, bool in_use)
{
	uint16 i;
	sep_type *pSeps;

#ifdef A2DP_DEBUG_LIB
	if (!sep_list)
		A2DP_DEBUG(("A2dpSetSepInUse NULL SEPs\n"));
#endif

	pSeps = sep_list->seps;

	for (i=0; i<sep_list->size_seps; i++)
	{
		if (pSeps->sep_config->seid == seid)
		{
			if (pSeps->in_use != in_use)
				pSeps->in_use = in_use;

			return;
		}

		pSeps++;
	}
}
Exemplo n.º 2
0
void A2dpOpen(A2DP *a2dp, uint16 size_local_seids, uint8 *local_seids)
{
	bdaddr addr;

#ifdef A2DP_DEBUG_LIB
	if (!a2dp)
		A2DP_DEBUG(("A2dpOpen NULL instance\n"));
#endif

	if (!local_seids || !size_local_seids)
    {
        /* If the user failed to supply connect params go no further. */
        a2dpSendOpenCfm(a2dp, a2dp->clientTask, a2dp_invalid_parameters);
		return;
    }

	if ((a2dp->signal_conn.connection_state != avdtp_connection_connected) || !SinkGetBdAddr(a2dp->signal_conn.sink, &addr))
	{
		/* There must be a signalling channel open first. */
        a2dpSendOpenCfm(a2dp, a2dp->clientTask, a2dp_no_signalling_connection);
		return;
	}

	a2dpFreeSeidListMemory(a2dp);

	a2dp->signal_conn.connect_then_open_media = FALSE;

	initiateOpen(a2dp, a2dp->clientTask, &addr, size_local_seids, local_seids);
}
Exemplo n.º 3
0
void A2dpSuspend(A2DP *a2dp)
{

#ifdef A2DP_DEBUG_LIB
	if (!a2dp)
		A2DP_DEBUG(("A2dpSuspend NULL instance\n"));
#endif

	MessageSend(&a2dp->task, A2DP_INTERNAL_SUSPEND_REQ, 0);
}
void A2dpReconfigure(A2DP *a2dp, uint16 size_sep_caps , uint8 *sep_caps)
{
	/* Send an internal message to initiate the connection. */
	MAKE_A2DP_MESSAGE(A2DP_INTERNAL_RECONFIGURE_REQ);

#ifdef A2DP_DEBUG_LIB
	if (!a2dp)
		A2DP_DEBUG(("A2dpReconfigure NULL instance\n"));
#endif

	message->size_sep_caps = size_sep_caps;
	message->sep_caps = sep_caps;
	MessageSend(&a2dp->task, A2DP_INTERNAL_RECONFIGURE_REQ, message);    
}
Exemplo n.º 5
0
Sink A2dpGetMediaSink(A2DP *a2dp)
{
    if (!a2dp)
    {
#ifdef A2DP_DEBUG_LIB
        A2DP_DEBUG(("A2dpGetMediaSink NULL instance\n"));
#endif
        return (Sink)0;
    }

	if (!a2dp->media_conn.media_connected)
		return (Sink)0;

    return a2dp->media_conn.sink;
}
Exemplo n.º 6
0
void A2dpConfigureCodecResponse(A2DP *a2dp, bool accept, uint16 size_codec_service_caps, uint8 *codec_service_caps)
{
	MAKE_A2DP_MESSAGE_WITH_LEN(A2DP_INTERNAL_CONFIGURE_CODEC_RSP, size_codec_service_caps);       

#ifdef A2DP_DEBUG_LIB
	if (!a2dp)
		A2DP_DEBUG(("A2dpConfigureCodecResponse NULL instance\n"));
#endif

	message->accept = accept;
	message->size_codec_service_caps = size_codec_service_caps;
	memmove(message->codec_service_caps, codec_service_caps, size_codec_service_caps); 

	MessageSend(&a2dp->task, A2DP_INTERNAL_CONFIGURE_CODEC_RSP, message);
}
static void handleUnexpected(uint16 type)
{
    A2DP_DEBUG(("A2DP handleUnexpected - MsgId 0x%x\n", type));
}