/****************************************************************************
*NAME    
*    AvrcpInformCharacterSetRequest   
*
*DESCRIPTION
*  API function to send InformDisplayableCharacterSet command to TG.
*****************************************************************************/
void AvrcpInformCharacterSetRequest( AVRCP   *avrcp, 
                                     uint16  size_attributes, 
                                     Source  attributes )
{
    avrcp_status_code status;
    uint8 num_char_set[1];

    /* Validate the number of attributes are in pair */
    if(size_attributes % 2)
    {
        avrcpSendCommonMetadataCfm(avrcp, 
                                   avrcp_rejected_invalid_param, 
                                   AVRCP_INFORM_CHARACTER_SET_CFM);
        return;
    }

    num_char_set[0] = size_attributes/2;

    status = avrcpMetadataControlCommand(avrcp, 
                                         AVRCP_INFORM_CHARACTER_SET_PDU_ID,
                                         avrcp_character_set, 1, num_char_set,
                                         size_attributes, attributes);

    if (status != avrcp_success)
    {
        avrcpSendCommonMetadataCfm(avrcp, status, 
                                   AVRCP_INFORM_CHARACTER_SET_CFM);
    }
}
/****************************************************************************
*NAME    
*    AvrcpSetAppValueRequest    
*
*DESCRIPTION
*  API function to send SetPlayerApplicationSettingValue request to TG.
*  All parameters are described in the header file.
******************************************************************************/
void AvrcpSetAppValueRequest( AVRCP *avrcp, 
                              uint16 size_attributes, 
                              Source attributes )
{
    avrcp_status_code status;
    uint8 num_attr[1];


    /* Size of Attributes should be multiple of 2 contains the ID & 
       Value combination */
    if(size_attributes % 2)
    {
        avrcpSendCommonMetadataCfm(avrcp, 
                                   avrcp_rejected_invalid_param, 
                                   AVRCP_SET_APP_VALUE_CFM);
        return;
    }

    num_attr[0] = size_attributes/2;

    status = avrcpMetadataControlCommand(avrcp, AVRCP_SET_APP_VALUE_PDU_ID,
                                         avrcp_set_app_values, 
                                         1, num_attr,
                                         size_attributes,attributes);

    if (status != avrcp_success)
    {
        avrcpSendCommonMetadataCfm(avrcp, status, AVRCP_SET_APP_VALUE_CFM);
    }
}
/****************************************************************************
*NAME    
*    AvrcpAbortContinuing    
*
*DESCRIPTION
*  API function to Abort Continuing Response.
*    
*PARAMETERS
*   avrcp            - Task
*   pdu_id           - PDU_ID of the received fragmented message to abort.
*
*RETURN
*  AVRCP_ABORT_CONTINUING_RESPONSE_CFM 
*******************************************************************************/
void AvrcpAbortContinuing(AVRCP *avrcp, uint16 pdu_id)
{
    uint8 params[] = {0};
    avrcp_status_code status;

    params[0] = pdu_id & 0xFF;

    status = avrcpMetadataStatusCommand(avrcp,
                                  AVRCP_ABORT_CONTINUING_RESPONSE_PDU_ID, 
                                  avrcp_abort_continuation, 1, params, 0, 0);

    if (status != avrcp_success)
    {
        avrcpSendCommonMetadataCfm(avrcp, status, 
                                   AVRCP_ABORT_CONTINUING_RESPONSE_CFM);
    }
}
/****************************************************************************
*NAME    
*    AvrcpInformBatteryStatusRequest    
*
*DESCRIPTION
*  API function to send InformBatteryStatusCommandOfCT command to TG.
*  All parameters are described in the header file.   
******************************************************************************/
void AvrcpInformBatteryStatusRequest(AVRCP *avrcp, 
                                  avrcp_battery_status battery_status)
{
    uint8 status_params[] = {0};
    avrcp_status_code status;

    status_params[0] = battery_status;

    status = avrcpMetadataControlCommand(avrcp,
                                         AVRCP_INFORM_BATTERY_STATUS_PDU_ID,
                                         avrcp_battery_information,
                                         sizeof(status_params),
                                         status_params,0,0);
    if (status != avrcp_success)
    {
        avrcpSendCommonMetadataCfm(avrcp, status, 
                                   AVRCP_INFORM_BATTERY_STATUS_CFM);
    }
}