コード例 #1
0
/****************************************************************************
*NAME    
*    AvrcpGetElementAttributes    
*
*DESCRIPTION
*  API function to request GetElementAttributes. 
*    
*PARAMETERS
*   avrcp            - Task
*   identifier_high -  Element identifier is 8 octets in big-endian format, 
*                      this parameter should be the most significant 4 
*                      octets. Currently only allowed identifier value is 
*                      PLAYING (0x0), so it must be set to 0.
*   identifier_low  - least significant 4 octets of the element identifier.
*                     currently allowed value is only PLAYING(0x0), so it 
*                     must be set to 0.
*   size_attributes - Size of attributes in Bytes
*   attributes      - list of attributes. 
*
*RETURN
*  AVRCP_GET_ELEMENT_ATTRIBUTES_CFM 
*******************************************************************************/
void AvrcpGetElementAttributes(AVRCP    *avrcp,
                               uint32   identifier_high, 
                               uint32   identifier_low, 
                               uint16   size_attributes, 
                               Source   attributes)
{
    uint8 extra_params[AVRCP_GET_ELEMENTS_HDR_SIZE];
    avrcp_status_code status;

    /* Fill in the extra Header for Get Elements which is Identifier and
       number of elements*/
    convertUint32ToUint8Values(&extra_params[0], identifier_high);
    convertUint32ToUint8Values(&extra_params[4], identifier_low);
    extra_params[8] = size_attributes/4;

    status = avrcpMetadataStatusCommand(avrcp, 
                                        AVRCP_GET_ELEMENT_ATTRIBUTES_PDU_ID,
                                        avrcp_get_element_attributes, 
                                        AVRCP_GET_ELEMENTS_HDR_SIZE, 
                                        extra_params,size_attributes,
                                        attributes);

    if (status != avrcp_success)
    {
        avrcpSendCommonFragmentedMetadataCfm(avrcp, status, 
                                            AVRCP_GET_ELEMENT_ATTRIBUTES_CFM, 
                                            0, 0, 0);
    }
}
コード例 #2
0
/****************************************************************************
* NAME    
* AvrcpListAppAttributeRequest    
*
* DESCRIPTION
* API to send ListPlayerApplicationSettingAttributes Command to the TG. On 
* completion this API, library returns the message AVRCP_LIST_APP_ATTRIBUTE_CFM.
* All parameters are described in the header file.
*******************************************************************************/
void AvrcpListAppAttributeRequest( AVRCP *avrcp )
{
    avrcp_status_code status = avrcpMetadataStatusCommand(avrcp,
                                        AVRCP_LIST_APP_ATTRIBUTES_PDU_ID, 
                                        avrcp_list_app_attributes,
                                        0, 0, 0, 0);

    if (status != avrcp_success)
    {
        avrcpSendCommonFragmentedMetadataCfm(avrcp, status, 
                                            AVRCP_LIST_APP_ATTRIBUTE_CFM, 
                                            0, 0, 0);
    }
}
コード例 #3
0
/****************************************************************************
* NAME    
* AvrcpListAppValueRequest    
*
* DESCRIPTION
* API to send ListPlayerApplicationSettingValue  to the CT. 
* All parameters are described in the header file.
*******************************************************************************/
void AvrcpListAppValueRequest(AVRCP *avrcp, uint16 attribute_id)
{
    uint8 status_params[] = {0};
    avrcp_status_code status;

    status_params[0] = attribute_id;

    status = avrcpMetadataStatusCommand(avrcp, AVRCP_LIST_APP_VALUE_PDU_ID,
                                        avrcp_list_app_values, 
                                        sizeof(status_params), 
                                        status_params, 0, 0);

    if (status != avrcp_success)
    {
        avrcpSendCommonFragmentedMetadataCfm(avrcp, status, 
                                             AVRCP_LIST_APP_VALUE_CFM, 
                                             0, 0, 0);
    }
}
コード例 #4
0
/****************************************************************************
*NAME    
*    AvrcpGetAppValueRequest    
*
*DESCRIPTION
*  API function to send GetCurrentPlayerApplicationSettingValue Request from CT.
*  All parameters are described in the header file.
******************************************************************************/
void AvrcpGetAppValueRequest( AVRCP   *avrcp, 
                              uint16  size_attributes, 
                              Source  attributes )
{
    uint8 extra_params[AVRCP_APP_NUM_ATTR_HDR_SIZE];
    avrcp_status_code status;

    extra_params[0] = size_attributes;

    status = avrcpMetadataStatusCommand(avrcp, AVRCP_GET_APP_VALUE_PDU_ID, 
                                        avrcp_get_app_values, 
                                        AVRCP_APP_NUM_ATTR_HDR_SIZE, 
                                        extra_params,
                                        size_attributes,
                                        attributes);

    if (status != avrcp_success)
    {
        avrcpSendCommonFragmentedMetadataCfm(avrcp, status,
                                             AVRCP_GET_APP_VALUE_CFM, 0, 0, 0);
    }
}
コード例 #5
0
/****************************************************************************
*NAME    
*    AvrcpGetAppValueText    
*
*DESCRIPTION
*  API function to send GetAppSettingValueText Request from CT.
*  All parameters are described in the header file.   
*****************************************************************************/
void AvrcpGetAppValueTextRequest(   AVRCP *avrcp, 
                                    uint16 attribute_id, 
                                    uint16 size_values, 
                                    Source values )
{
    uint8 extra_params[AVRCP_APP_VAL_TXT_HDR_SIZE];
    avrcp_status_code status;

    extra_params[0] = attribute_id;
    extra_params[1] = size_values;

    status = avrcpMetadataStatusCommand(avrcp, 
                                        AVRCP_GET_APP_VALUE_TEXT_PDU_ID, 
                                        avrcp_get_app_value_text,  
                                         AVRCP_APP_VAL_TXT_HDR_SIZE,
                                        extra_params,size_values,values);

    if (status != avrcp_success)
    {
        avrcpSendCommonFragmentedMetadataCfm(avrcp, status, 
                                              AVRCP_GET_APP_VALUE_TEXT_CFM, 
                                             0, 0, 0);
    }
}