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_output_getdevicestatus_                 */
37 /*                                       dpsprintservicestatus            */
38 /*                                                        PORTABLE C      */
39 /*                                                           6.1          */
40 /*                                                                        */
41 /*                                                                        */
42 /*  AUTHOR                                                                */
43 /*                                                                        */
44 /*    Chaoqiong Xiao, Microsoft Corporation                               */
45 /*                                                                        */
46 /*  DESCRIPTION                                                           */
47 /*                                                                        */
48 /*    This function decodes the dpsprintservicestatus tag                 */
49 /*                                                                        */
50 /*  INPUT                                                                 */
51 /*                                                                        */
52 /*    pictbridge                             Pictbridge instance          */
53 /*    input_variable                         Pointer to variable          */
54 /*    input_string                           Pointer to string            */
55 /*    xml_parameter                          Pointer to xml parameter     */
56 /*                                                                        */
57 /*  OUTPUT                                                                */
58 /*                                                                        */
59 /*    Completion Status                                                   */
60 /*                                                                        */
61 /*  CALLS                                                                 */
62 /*                                                                        */
63 /*                                                                        */
64 /*  CALLED BY                                                             */
65 /*                                                                        */
66 /*    _ux_pictbridge_object_parse                                         */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  05-19-2020     Chaoqiong Xiao           Initial Version 6.0           */
73 /*  09-30-2020     Chaoqiong Xiao           Modified comment(s),          */
74 /*                                            resulting in version 6.1    */
75 /*                                                                        */
76 /**************************************************************************/
_ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE * pictbridge,UCHAR * input_variable,UCHAR * input_string,UCHAR * xml_parameter)77 UINT  _ux_pictbridge_xml_function_output_getdevicestatus_dpsprintservicestatus(UX_PICTBRIDGE *pictbridge,
78                             UCHAR *input_variable, UCHAR *input_string, UCHAR *xml_parameter)
79 {
80 UINT    status;
81 ULONG   hexa_element;
82 
83     UX_PARAMETER_NOT_USED(input_string);
84     UX_PARAMETER_NOT_USED(input_variable);
85 
86     /* Get the dpsprintservicestatus variable.  */
87     status = _ux_pictbridge_element_to_hexa(xml_parameter, &hexa_element);
88 
89     /* Check status.  */
90     if (status == UX_SUCCESS)
91     {
92         /* Check the returned value. Must be one of 3 possibilities.  */
93         if (hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_ACTIVE ||
94             hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_IDLE ||
95             hexa_element == UX_PICTBRIDGE_DPS_PRINTSERVICE_STATUS_PAUSED)
96         {
97 
98             /* Save this value.  */
99             pictbridge -> ux_pictbridge_dpsclient.ux_pictbridge_devinfo_dpsprintservicestatus = hexa_element;
100 
101            /* We are done. */
102             return(UX_SUCCESS);
103         }
104     }
105 
106     /* We get here when we reached an unexpected end of the XML object or a format error.  */
107     return(UX_PICTBRIDGE_ERROR_SCRIPT_SYNTAX_ERROR);
108 
109 
110 }
111 
112 
113