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 #include "ux_device_class_pima.h"
31
32
33 /**************************************************************************/
34 /* */
35 /* FUNCTION RELEASE */
36 /* */
37 /* _ux_pictbridge_dpsclient_object_handles_get PORTABLE C */
38 /* 6.1 */
39 /* AUTHOR */
40 /* */
41 /* Chaoqiong Xiao, Microsoft Corporation */
42 /* */
43 /* DESCRIPTION */
44 /* */
45 /* This function returns the handles array. */
46 /* */
47 /* INPUT */
48 /* */
49 /* pima Pima instance associated */
50 /* */
51 /* OUTPUT */
52 /* */
53 /* Completion Status */
54 /* */
55 /* CALLS */
56 /* */
57 /* */
58 /* CALLED BY */
59 /* */
60 /* user application */
61 /* */
62 /* RELEASE HISTORY */
63 /* */
64 /* DATE NAME DESCRIPTION */
65 /* */
66 /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
67 /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
68 /* resulting in version 6.1 */
69 /* */
70 /**************************************************************************/
_ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA * pima,ULONG object_handles_format_code,ULONG object_handles_association,ULONG * object_handles_array,ULONG object_handles_max_number)71 UINT _ux_pictbridge_dpsclient_object_handles_get(UX_SLAVE_CLASS_PIMA *pima,
72 ULONG object_handles_format_code,
73 ULONG object_handles_association,
74 ULONG *object_handles_array,
75 ULONG object_handles_max_number)
76 {
77 UX_PICTBRIDGE *pictbridge;
78 UX_SLAVE_CLASS_PIMA_OBJECT *object_info;
79
80 UX_PARAMETER_NOT_USED(object_handles_association);
81 UX_PARAMETER_NOT_USED(object_handles_max_number);
82
83 /* Get the pointer to the Pictbridge instance. */
84 pictbridge = (UX_PICTBRIDGE *) pima -> ux_device_class_pima_application;
85
86 /* Set the pima pointe to the pictbridge instance. */
87 pictbridge -> ux_pictbridge_pima = (VOID *) pima;
88
89 /* We say we have one object but the caller might specify different format code and associations. */
90 object_info = pictbridge -> ux_pictbridge_object_client;
91
92 /* Insert in the array the number of found handles so far : 0. */
93 _ux_utility_long_put((UCHAR *)object_handles_array, 0);
94
95 /* Check the type demanded. */
96 if (object_handles_format_code == 0 || object_handles_format_code == 0xFFFFFFFF ||
97 object_info -> ux_device_class_pima_object_format == object_handles_format_code)
98 {
99
100 /* Insert in the array the number of found handles. This handle is for the client XML script. */
101 _ux_utility_long_put((UCHAR *)object_handles_array, 1);
102
103 /* Adjust the array to point after the number of elements. */
104 object_handles_array++;
105
106 /* We have a candidate. Store the handle. */
107 _ux_utility_long_put((UCHAR *)object_handles_array, object_info -> ux_device_class_pima_object_handle_id);
108
109 }
110
111 return(UX_SUCCESS);
112 }
113
114