components/bt/host/bluedroid/stack/a2dp/a2dp_vendor_aptx.c
tA2DP_STATUS A2DP_BuildInfoAptx(uint8_t media_type,const tA2DP_APTX_CIE* p_ie,uint8_t* p_result)
{
  if (p_ie == NULL || p_result == NULL) {
    return A2DP_INVALID_PARAMS;
  }

  *p_result++ = A2DP_APTX_CODEC_LEN;
  *p_result++ = (media_type << 4);
  *p_result++ = A2DP_MEDIA_CT_NON_A2DP;
  *p_result++ = (uint8_t)(p_ie->vendorId & 0x000000FF);
  *p_result++ = (uint8_t)((p_ie->vendorId & 0x0000FF00) >> 8);
  *p_result++ = (uint8_t)((p_ie->vendorId & 0x00FF0000) >> 16);
  *p_result++ = (uint8_t)((p_ie->vendorId & 0xFF000000) >> 24);
  *p_result++ = (uint8_t)(p_ie->codecId & 0x00FF);
  *p_result++ = (uint8_t)((p_ie->codecId & 0xFF00) >> 8);
  *p_result++ = p_ie->sampleRate | p_ie->channelMode;

  return A2DP_SUCCESS;
}
/*
 * Builds the aptX Media Codec Capabilities byte sequence beginning from the
 * LOSC octet. |media_type| is the media type |AVDT_MEDIA_TYPE_*|.
 * |p_ie| is a pointer to the aptX Codec Information Element information.
 * The result is stored in |p_result|. Returns A2DP_SUCCESS on success,
 * otherwise the corresponding A2DP error status code.
 */
Builds the aptX Media Codec Capabilities byte sequence beginning from the
LOSC octet.
Builds the aptX Media Codec Capabilities byte sequence beginning from the LOSC octet .
tA2DP_STATUS A2DP_BuildInfoAptx(uint8_t media_type,const tA2DP_APTX_CIE* p_ie,uint8_t* p_result)
{
  if (p_ie == NULL || p_result == NULL) {
    return A2DP_INVALID_PARAMS;
  }
  *p_result++ = A2DP_APTX_CODEC_LEN;
  *p_result++ = (media_type << 4);
  *p_result++ = A2DP_MEDIA_CT_NON_A2DP;
  *p_result++ = (uint8_t)(p_ie->vendorId & 0x000000FF);
  *p_result++ = (uint8_t)((p_ie->vendorId & 0x0000FF00) >> 8);
  *p_result++ = (uint8_t)((p_ie->vendorId & 0x00FF0000) >> 16);
  *p_result++ = (uint8_t)((p_ie->vendorId & 0xFF000000) >> 24);
  *p_result++ = (uint8_t)(p_ie->codecId & 0x00FF);
  *p_result++ = (uint8_t)((p_ie->codecId & 0xFF00) >> 8);
  *p_result++ = p_ie->sampleRate | p_ie->channelMode;
  return A2DP_SUCCESS;
}
tA2DP_STATUS A2DP_BuildInfoAptx ( uint8_t media_type , const tA2DP_APTX_CIE * p_ie , uint8_t * p_result ) { if ( p_ie == NULL || p_result == NULL ) { return A2DP_INVALID_PARAMS ; } * p_result ++ = A2DP_APTX_CODEC_LEN ; * p_result ++ = ( media_type << 4 ) ; * p_result ++ = A2DP_MEDIA_CT_NON_A2DP ; * p_result ++ = ( uint8_t ) ( p_ie -> vendorId & 0x000000FF ) ; * p_result ++ = ( uint8_t ) ( ( p_ie -> vendorId & 0x0000FF00 ) >> 8 ) ; * p_result ++ = ( uint8_t ) ( ( p_ie -> vendorId & 0x00FF0000 ) >> 16 ) ; * p_result ++ = ( uint8_t ) ( ( p_ie -> vendorId & 0xFF000000 ) >> 24 ) ; * p_result ++ = ( uint8_t ) ( p_ie -> codecId & 0x00FF ) ; * p_result ++ = ( uint8_t ) ( ( p_ie -> codecId & 0xFF00 ) >> 8 ) ; * p_result ++ = p_ie -> sampleRate | p_ie -> channelMode ; return A2DP_SUCCESS ; }
Builds the aptX Media Codec Capabilities byte sequence beginning from the
 LOSC octet.
Builds the aptX Media Codec Capabilities byte sequence beginning from the LOSC octet .