static void sendEncryptionChangeInd(const CL_SM_ENCRYPTION_CHANGE_IND_T *ind)
{
    MAKE_A2DP_MESSAGE(A2DP_ENCRYPTION_CHANGE_IND);
    message->encrypted = ind->encrypted;
    message->a2dp = a2dp;
    MessageSend(a2dp->clientTask, A2DP_ENCRYPTION_CHANGE_IND, message);
}
void a2dpSendReconfigureCfm(A2DP *a2dp, a2dp_status_code status)
{
    MAKE_A2DP_MESSAGE(A2DP_RECONFIGURE_CFM);
    message->a2dp = a2dp;
    message->status = status;
    MessageSend(a2dp->clientTask, A2DP_RECONFIGURE_CFM, message);
}
static void sendSignallingCloseInd(A2DP* a2dp, Sink sink, a2dp_status_code status)
{
	MAKE_A2DP_MESSAGE(A2DP_SIGNALLING_CHANNEL_DISCONNECT_IND);
	message->a2dp = a2dp;
	message->sink = sink;
	message->status = status;
	MessageSend(a2dp->clientTask, A2DP_SIGNALLING_CHANNEL_DISCONNECT_IND, message);
}		
void sendStartCfm(A2DP *a2dp, Sink sink, a2dp_status_code status)
{
	MAKE_A2DP_MESSAGE(A2DP_START_CFM);
	message->media_sink	= sink;
	message->status = status;
	message->a2dp = a2dp;
	MessageSend(a2dp->clientTask, A2DP_START_CFM, message);
}
Exemplo n.º 5
0
void a2dpSendInitCfmToClient(a2dp_status_code status)
{
    MAKE_A2DP_MESSAGE(A2DP_INIT_CFM);
    message->status = status;
    MessageSend(a2dp->clientTask, A2DP_INIT_CFM, message);

    /* If the initialisation failed, free the allocated task */
    if (status != a2dp_success)
    {
        free(a2dp);
        a2dp = 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.º 7
0
static void initiateOpen(A2DP *a2dp, Task clientTask, const bdaddr *addr, uint16 size_local_seids, uint8 *local_seids)
{
	sep_type *pSeps = NULL;

	a2dp->sep.list_preferred_local_seids = (uint8 *) malloc(sizeof(uint8) * size_local_seids);
	memmove(a2dp->sep.list_preferred_local_seids, local_seids, size_local_seids);
	a2dp->sep.max_preferred_local_seids = size_local_seids;
	a2dp->sep.current_preferred_local_seid = 0;

	pSeps = getSepInstanceBySeid(a2dp, a2dp->sep.list_preferred_local_seids[0]);

	if (pSeps == NULL)
	{
		/* If the SEID is not valid then can't proceed. */
		if (a2dp->signal_conn.connect_then_open_media)
                {
			a2dpSendConnectOpenCfm(a2dp, clientTask, a2dp_invalid_parameters);
                        /* ensure we delete the a2dp instance */
                        a2dpDeleteTask(a2dp);
                }
		else
			a2dpSendOpenCfm(a2dp, clientTask, a2dp_invalid_parameters);
                        /* don't delete a2dp instance, we have a signalling channel on the go */
		return;
	}

	a2dp->sep.current_sep = pSeps;

	{
		/* Send an internal message to initiate the connection. */
		MAKE_A2DP_MESSAGE(A2DP_INTERNAL_OPEN_REQ);
		message->client = a2dp->clientTask;
		message->addr = *addr;
		MessageSend(&a2dp->task, A2DP_INTERNAL_OPEN_REQ, message);    
	}
}