components/bt/host/bluedroid/stack/a2dp/a2dp_vendor_aptx.c
UINT8 bta_av_aptx_cfg_in_cap(UINT8 *p_cfg, tA2DP_APTX_CIE *p_cap)
{
    UINT8           status = 0;
    tA2DP_APTX_CIE    cfg_cie;

	// add by nishi
    APPL_TRACE_DEBUG("%s(): #1 called!!",__func__);
    /* parse configuration */
    if ((status = A2DP_ParseInfoAptx(&cfg_cie, p_cfg, FALSE,"bta_av_aptx_cfg_in_cap()")) != 0) {
        return status;
    }

    /* verify that each parameter is in range */

    /* sampling frequency */
    if ((cfg_cie.sampleRate & p_cap->sampleRate) == 0) {
        status = A2D_NS_SAMP_FREQ;
    }
    /* channel mode */
    else if ((cfg_cie.channelMode & p_cap->channelMode) == 0) {
        status = A2D_NS_CH_MODE;
    }
    /* block length */
    //else if ((cfg_cie.block_len & p_cap->block_len) == 0) {
    //    status = A2D_BAD_BLOCK_LEN;
    //}
    /* subbands */
    //else if ((cfg_cie.num_subbands & p_cap->num_subbands) == 0) {
    //    status = A2D_NS_SUBBANDS;
    //}
    /* allocation method */
    //else if ((cfg_cie.alloc_mthd & p_cap->alloc_mthd) == 0) {
    //    status = A2D_NS_ALLOC_MTHD;
    //}
    /* max bitpool */
    //else if (cfg_cie.max_bitpool > p_cap->max_bitpool) {
    //    status = A2D_NS_MAX_BITPOOL;
    //}
    /* min bitpool */
    //else if (cfg_cie.min_bitpool < p_cap->min_bitpool) {
    //    status = A2D_NS_MIN_BITPOOL;
    //}

    return status;
}
/*******************************************************************************
**
** Function         bta_av_aptx_cfg_in_cap
**
** Description      This function checks whether an APTX codec configuration
**                  is allowable for the given codec capabilities.
**
** Returns          0 if ok, nonzero if error.
**
*******************************************************************************/
Function         bta_av_aptx_cfg_in_cap
Description      This function checks whether an APTX codec configuration
is allowable for the given codec capabilities.

Returns          0 if ok, nonzero if error.
Function bta_av_aptx_cfg_in_cap Description This function checks whether an APTX codec configuration is allowable for the given codec capabilities . Returns 0 if ok nonzero if error .
UINT8 bta_av_aptx_cfg_in_cap(UINT8 *p_cfg, tA2DP_APTX_CIE *p_cap)
{
    UINT8           status = 0;
    tA2DP_APTX_CIE    cfg_cie;
    APPL_TRACE_DEBUG("%s(): #1 called!!",__func__);
    if ((status = A2DP_ParseInfoAptx(&cfg_cie, p_cfg, FALSE,"bta_av_aptx_cfg_in_cap()")) != 0) {
        return status;
    }
    if ((cfg_cie.sampleRate & p_cap->sampleRate) == 0) {
        status = A2D_NS_SAMP_FREQ;
    }
    else if ((cfg_cie.channelMode & p_cap->channelMode) == 0) {
        status = A2D_NS_CH_MODE;
    }
    return status;
}
UINT8 bta_av_aptx_cfg_in_cap ( UINT8 * p_cfg , tA2DP_APTX_CIE * p_cap ) { UINT8 status = 0 ; tA2DP_APTX_CIE cfg_cie ; APPL_TRACE_DEBUG ( " " , __func__ ) ; if ( ( status = A2DP_ParseInfoAptx ( & cfg_cie , p_cfg , FALSE , " " ) ) != 0 ) { return status ; } if ( ( cfg_cie . sampleRate & p_cap -> sampleRate ) == 0 ) { status = A2D_NS_SAMP_FREQ ; } else if ( ( cfg_cie . channelMode & p_cap -> channelMode ) == 0 ) { status = A2D_NS_CH_MODE ; } return status ; }
Function         bta_av_aptx_cfg_in_cap
Description      This function checks whether an APTX codec configuration
is allowable for the given codec capabilities.
Function bta_av_aptx_cfg_in_cap Description This function checks whether an APTX codec configuration is allowable for the given codec capabilities .
// add by nishi /* parse configuration */ /* verify that each parameter is in range */ /* sampling frequency */ /* channel mode */ /* block length */ //else if ((cfg_cie.block_len & p_cap->block_len) == 0) { //    status = A2D_BAD_BLOCK_LEN; //} /* subbands */ //else if ((cfg_cie.num_subbands & p_cap->num_subbands) == 0) { //    status = A2D_NS_SUBBANDS; //} /* allocation method */ //else if ((cfg_cie.alloc_mthd & p_cap->alloc_mthd) == 0) { //    status = A2D_NS_ALLOC_MTHD; //} /* max bitpool */ //else if (cfg_cie.max_bitpool > p_cap->max_bitpool) { //    status = A2D_NS_MAX_BITPOOL; //} /* min bitpool */ //else if (cfg_cie.min_bitpool < p_cap->min_bitpool) { //    status = A2D_NS_MIN_BITPOOL; //}