void ConnectionL2capConnectRequestTestExtraConftab(
        Task theAppTask,
        const bdaddr *addr,
        uint16 psm_local,
        uint16 psm_remote,
        uint16 size_conftab,
        uint8 *conftab
        )
{
    if (size_conftab)
    {
        /* copy the conftab data to a slot */
        uint16* dyn_conftab = malloc(sizeof(uint16)* (size_conftab/2));
        uint16 it;

        for(it=0; it<size_conftab/2; it++)
        {
            dyn_conftab[it] =  *conftab++ << 8;
            dyn_conftab[it] |= *conftab++;
        }

        ConnectionL2capConnectRequest(
            theAppTask, addr, psm_local, psm_remote,
            (size_conftab/2), dyn_conftab);
    }
    else
    {
        ConnectionL2capConnectRequest(
            theAppTask, addr, psm_local, psm_remote,
            0, 0);
    }        
}
/****************************************************************************
NAME	
	avrcpHandleInternalConnectReq

DESCRIPTION
	This function handles an internally generated connect request message.
*/
void avrcpHandleInternalConnectReq(AVRCP *avrcp, const AVRCP_INTERNAL_CONNECT_REQ_T *req)
{
	/* Set the state to connecting */
	avrcpSetState(avrcp, avrcpConnecting);

	/* Initiate the L2CAP connection */
	ConnectionL2capConnectRequest(&avrcp->task, &req->bd_addr, AVCTP_PSM, AVCTP_PSM, 0);
}
示例#3
0
/****************************************************************************
NAME 
	hidConnectingLocalEnter
DESCRIPTION
	Called whenever the HID instance enters the local connecting state.
	Initiates the control channel L2CAP connection.
RETURNS
	void
*/
static void hidConnectingLocalEnter(HID *hid)
{
    l2cap_config_params l2cap_config;
	HID_PRINT(("hidConnectingLocalEnter\n"));

    /* Start outgoing control connection */
	hidL2capConfigure(hid, &l2cap_config, HID_PSM_CONTROL);
    hidConnConnecting(hid, HID_PSM_CONTROL, 0);
    ConnectionL2capConnectRequest(&hid->task, &hid->remote_addr, HID_PSM_CONTROL, HID_PSM_CONTROL, &l2cap_config);

	/* Set default connect status */
	hid->connect_status = hid_connect_success;
}
void ConnectionL2capConnectRequestTestExtraDefault(
        Task theAppTask,
        const bdaddr *addr,
        uint16 psm_local,
        uint16 psm_remote
        )
{
    ConnectionL2capConnectRequest(
            theAppTask,
            addr,
            psm_local,
            psm_remote,
            0,
            0
            );
}