コード例 #1
0
void ConnectionSdpServiceSearchAttributeRefRequest(Task appTask, const bdaddr *addr, uint16 max_attributes, uint16 size_search_pattern, const uint8 *search_pattern, uint16 size_attr_list, const uint8 *attr_list)
{
    ConnectionSdpServiceSearchAttributeRequest(
        appTask,
        addr,
        max_attributes | REF_FLAG,
        size_search_pattern, search_pattern,
        size_attr_list, attr_list);
}
コード例 #2
0
/***************************************************************************
 * NAME
 *  mapcSdpSearch
 *
 * DESCRIPTION 
 *  Initiate an SDP Service Attribute Search
 *
 * PARAMETERS 
 * theTask      - The task to receive the result
 * addr         - The Remote MSE device
 **************************************************************************/
void mapcSdpSearch( Task  theTask , const bdaddr* addr )
{
    ConnectionSdpServiceSearchAttributeRequest( theTask, 
                                                addr, 
                                                MAPC_MAX_SDP_ATTR_SIZE,
                                                sizeof(serviceRequest),
                                                serviceRequest,
                                                sizeof(attrRequest),
                                                attrRequest );
}
コード例 #3
0
ファイル: hfp_sdp.c プロジェクト: stephen-kun/koovox_adk4.0
/****************************************************************************
NAME    
    hfpGetProfileServerChannel

DESCRIPTION
    Initiate a service search to get the rfcomm server channel of the 
    required service on the remote device. We need this before we can 
    initiate a service level connection.

RETURNS
    void
*/
void hfpGetProfileServerChannel(hfp_link_data* link, hfp_service_data* service, const bdaddr *bd_addr)
{
    /* Default to HFP search */
    uint16 sp_len = sizeof(HfpServiceRequest);
    uint8* sp_ptr = (uint8 *) HfpServiceRequest;

    /* Set up the link data */
    hfpLinkSetup(link, service, bd_addr, NULL, hfp_slc_searching);
    
    /* Check if we're searching for HSP */
    if (hfpLinkIsHsp(link))
    {
        sp_ptr = (uint8 *) HspServiceRequest;
        sp_len = sizeof(HspServiceRequest);
    }

    /* Kick off the search */
    ConnectionSdpServiceSearchAttributeRequest(&theHfp->task, bd_addr, 0x32, sp_len, sp_ptr, sizeof(protocolAttributeRequest), protocolAttributeRequest);
}
コード例 #4
0
ファイル: hfp_sdp.c プロジェクト: stephen-kun/koovox_adk4.0
/****************************************************************************
NAME    
    hfpGetAgSupportedFeatures

DESCRIPTION
    AG does not support BRSF command so we need to perform an SDP search
    to get its supported features.

RETURNS
    void
*/
void hfpGetAgSupportedFeatures(hfp_link_data* link)
{
    bdaddr link_addr;
    
    if (hfpGetLinkBdaddr(link, &link_addr))
    {
        /* 
            Issue the search request to the connection lib. The max number of attribute bytes
            is set to an arbitrary number, however the aim is to set it to a value so that
            if the remote end returns this many bytes we still have a block big enough to
            copy the data into. 
        */
        ConnectionSdpServiceSearchAttributeRequest(&theHfp->task, &link_addr, 0x32, sizeof(HfpServiceRequest), (uint8 *) HfpServiceRequest, sizeof(supportedFeaturesAttributeRequest), supportedFeaturesAttributeRequest);
    }
    else
    {
        /* Something has gone wrong - panic */
        HFP_DEBUG(("Failed to get link addr\n"));
    }
}
コード例 #5
0
/****************************************************************************
NAME	
	hfpGetAgProfileVersion

DESCRIPTION
	Requests HFP profile version supported by the AG.
	
RETURNS
	void
*/
void hfpGetAgProfileVersion(HFP *hfp)
{
	bdaddr my_addr;

	if (SinkGetBdAddr(hfp->sink, &my_addr))
	{
		/* 
			Issue the search request to the connection lib. The max number of attribute bytes
			is set to an arbitrary number, however the aim is to set it to a value so that
			if the remote end returns this many bytes we still have a block big enough to
			copy the data into. 
		*/
		hfp->sdp_search_mode = hfp_sdp_search_profile_version;
		ConnectionSdpServiceSearchAttributeRequest(&hfp->task, &my_addr, 0x32, sizeof(HfpServiceRequest), (uint8 *) HfpServiceRequest, sizeof(profileDescriptorRequest), profileDescriptorRequest);
	}
	else
	{
		/* Something has gone wrong - panic */
		HFP_DEBUG(("SinkGetBdAddr failed\n"));
	}
}
コード例 #6
0
/****************************************************************************
 Initiate a service search to get the rfcomm server channel of the
 required service on the remote device. We need this before we can
 initiate a service level connection.
*/
void aghfpGetProfileServerChannel(AGHFP *aghfp, const bdaddr *addr)
{
	uint16 sp_len;
	uint8 *sp_ptr;

	sp_len = 0;
	sp_ptr = 0;

	/* Check which profile we support so we can device which search to use */
	if (supportedProfileIsHsp(aghfp->supported_profile))
	{
		/* This task supports the HSP */
		sp_ptr = (uint8 *) HspServiceRequest;
		sp_len = sizeof(HspServiceRequest);
	}
	else if (supportedProfileIsHfp(aghfp->supported_profile))
	{
		/* This task supports the HFP */
		sp_ptr = (uint8 *)HfpServiceRequest;
		sp_len = sizeof(HfpServiceRequest);
	}
	else
	{
		/* This should never happen */
		Panic();
	}

	/*  Issue the search request to the connection lib. The max number of attribute bytes
	is set to an arbitrary number, however the aim is to set it to a value so that
	if the remote end returns this many bytes we still have a block big enough to
	copy the data into.
	*/
	ConnectionSdpServiceSearchAttributeRequest(
		&aghfp->task, addr, 0x32,
        sp_len, sp_ptr,
        sizeof(protocolAttributeRequest),
        protocolAttributeRequest);
}
コード例 #7
0
void ConnectionSdpServiceSearchAttributeRequestTestExtra(
        Task theAppTask,
        const bdaddr *addr,
        uint16 max_attributes,
        uint16 size_search_pattern,
        uint16 size_attribute_list,
        uint16 size_search_attribute_list,
        const uint8 *search_attribute_list
        )
{
    /* Unused in the shim layer but needed to generate the message from rfcli */
    size_search_attribute_list = size_search_attribute_list;

    ConnectionSdpServiceSearchAttributeRequest(
            theAppTask,
            addr,
            max_attributes,
            size_search_pattern,
            search_attribute_list,
            size_attribute_list,
            search_attribute_list+size_search_pattern
            );
}