void ConnectionRfcommConnectRequestTestExtraParams( Task theAppTask, const bdaddr* bd_addr, uint16 security_chan, uint8 remote_server_chan, uint16 max_payload_size, uint8 modem_signal, uint8 break_signal, uint16 msc_timeout ) { rfcomm_config_params params; params.max_payload_size = max_payload_size; params.modem_signal = modem_signal; params.break_signal = break_signal; params.msc_timeout = msc_timeout ; ConnectionRfcommConnectRequest( theAppTask, bd_addr, security_chan, remote_server_chan, ¶ms ); }
/**************************************************************************** NAME hfpHandleRfcommConnectRequest DESCRIPTION Issue a request to the connection lib to create an RFCOMM connection. RETURNS void */ void hfpHandleRfcommConnectRequest(HFP *hfp, const HFP_INTERNAL_RFCOMM_CONNECT_REQ_T *req) { if(!(hfp->rfcomm_lock)) { hfp->rfcomm_lock = TRUE; /* Issue the connect request to the connection lib. */ ConnectionRfcommConnectRequest(&hfp->task, &req->addr, hfp->local_rfc_server_channel, req->rfc_channel, 0); } }
void ConnectionRfcommConnectRequestTestExtraDefault( Task theAppTask, const bdaddr* bd_addr, uint16 security_chan, uint8 remote_server_chan ) { ConnectionRfcommConnectRequest( theAppTask, bd_addr, security_chan, remote_server_chan, 0 ); }
/**************************************************************************** NAME hfpHandleServiceSearchAttributeCfm DESCRIPTION Service search has completed, check it has succeeded and get the required attrubutes from the returned list. RETURNS void */ void hfpHandleServiceSearchAttributeCfm(const CL_SDP_SERVICE_SEARCH_ATTRIBUTE_CFM_T *cfm) { /* Get the link from the bdaddr */ hfp_link_data* link = hfpGetLinkFromBdaddr(&cfm->bd_addr); /* The link may have been pulled from under us by an early disconnect request. If this has happened ignore SDP result */ if(link) { /* Check the outcome of the service search */ if (cfm->status == sdp_response_success) { uint16 sdp_data = 0; if(link->ag_slc_state == hfp_slc_searching) { if (getRfcommChannelNumber(cfm->attributes, cfm->attributes+cfm->size_attributes, &sdp_data)) { /* We have an rfcomm channel we can proceed with the connection establishment */ hfpSetLinkSlcState(link, hfp_slc_outgoing); /* Use the local channel to specify the security requirements for this connection */ ConnectionRfcommConnectRequest(&theHfp->task, &cfm->bd_addr, link->service->rfc_server_channel, sdp_data, 0); } else { /* Received unexpected data. Should never happen since we're issuing the search and should know what we're looking. However, if it does, treat as SDP failure. */ hfpSdpRetry(link); } } else if(link->ag_slc_state == hfp_slc_connected) { /* If SLC is up then this must be a features request */ if (getHfpAgSupportedFeatures(cfm->attributes, cfm->attributes+cfm->size_attributes, &sdp_data)) { /* Send an internal message with the supported features. */ hfpHandleSupportedFeaturesNotification(link, sdp_data); } /* else { Received unexpected data. Should never happen since we're issuing the search and should know what we're looking. However, if it does, just ignore since SLC setup is already being continued. } */ } } else { /* RFCOMM channel search failed, tell the application */ if(link->ag_slc_state == hfp_slc_searching) { if (cfm->status == sdp_no_response_data) { /* Retry next profile if possible... */ hfpSdpRetry(link); } else { /* Generic fail by default */ hfp_connect_status status = hfp_connect_failed; /* Was it a page timeout? */ if (cfm->status == sdp_connection_error) status = hfp_connect_timeout; /* Tell the app */ hfpSendSlcConnectCfmToApp(link, NULL, status); } } } } }