1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 13 /**************************************************************************/ 14 /**************************************************************************/ 15 /** */ 16 /** USBX Component */ 17 /** */ 18 /** Pictbridge Application */ 19 /** */ 20 /**************************************************************************/ 21 /**************************************************************************/ 22 23 24 /* Include necessary system files. */ 25 26 #define UX_SOURCE_CODE 27 28 #include "ux_api.h" 29 #include "ux_pictbridge.h" 30 31 32 /**************************************************************************/ 33 /* */ 34 /* FUNCTION RELEASE */ 35 /* */ 36 /* _ux_pictbridge_xml_function_input_notifydevicestatus_ */ 37 /* disconnectenable */ 38 /* POTABLE C */ 39 /* 6.1 */ 40 /* */ 41 /* */ 42 /* */ 43 /* AUTHOR */ 44 /* */ 45 /* Chaoqiong Xiao, Microsoft Corporation */ 46 /* */ 47 /* DESCRIPTION */ 48 /* */ 49 /* This function decodes the disconnectenable tag */ 50 /* */ 51 /* INPUT */ 52 /* */ 53 /* pictbridge Pictbridge instance */ 54 /* input_variable Pointer to variable */ 55 /* input_string Pointer to string */ 56 /* xml_parameter XML parameter */ 57 /* */ 58 /* OUTPUT */ 59 /* */ 60 /* Completion Status */ 61 /* */ 62 /* CALLS */ 63 /* */ 64 /* */ 65 /* CALLED BY */ 66 /* */ 67 /* _ux_pictbridge_object_parse */ 68 /* */ 69 /* RELEASE HISTORY */ 70 /* */ 71 /* DATE NAME DESCRIPTION */ 72 /* */ 73 /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ 74 /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ 75 /* resulting in version 6.1 */ 76 /* */ 77 /**************************************************************************/ _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE * pictbridge,UCHAR * input_variable,UCHAR * input_string,UCHAR * xml_parameter)78UINT _ux_pictbridge_xml_function_input_notifydevicestatus_disconnectenable(UX_PICTBRIDGE *pictbridge, 79 UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter) 80 { 81 82 UINT status; 83 ULONG hexa_element; 84 85 UX_PARAMETER_NOT_USED(input_string); 86 UX_PARAMETER_NOT_USED(input_variable); 87 88 /* Get the disconnectenable variable. */ 89 status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_element); 90 91 /* Check status. */ 92 if (status == UX_SUCCESS) 93 { 94 95 /* Check the returned value. Must be one of 2 possibilities. */ 96 if (hexa_element == UX_PICTBRIDGE_DISCONNECT_ENABLE_FALSE || 97 hexa_element == UX_PICTBRIDGE_DISCONNECT_ENABLE_TRUE) 98 { 99 100 /* Save this value. */ 101 pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_disconnectenable = hexa_element; 102 103 /* We are done. */ 104 return(UX_SUCCESS); 105 } 106 } 107 108 /* We get here when we reached an unexpected end of the XML object or a format error. */ 109 return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR); 110 111 } 112 113 114