• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @addtogroup HdfFaceAuth
18 * @{
19 *
20 * @brief Provides APIs for the face auth driver.
21 *
22 * The face auth driver provides a unified interface for the face auth service to access the face auth driver.
23 * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors.
24 * After obtaining the face auth executors, the service can call related APIs to get executor info, get
25 * template info, enroll template, authenticate template, delete template, etc.
26 *
27 * @since 3.2
28 */
29
30/**
31 * @file IExecutor.idl
32 *
33 * @brief Defines the APIs of executor. These APIs can be used to get executor info, get
34 * template info, enroll template, authenticate template, delete template, etc.
35 *
36 * @since 3.2
37 */
38
39package ohos.hdi.face_auth.v1_0;
40
41import ohos.hdi.face_auth.v1_0.FaceAuthTypes;
42import ohos.hdi.face_auth.v1_0.IExecutorCallback;
43sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable;
44
45/**
46 * @brief Defines the APIs of executor. These APIs can be used to get executor info, get
47 * template info, enroll template, authenticate template, delete template, etc.
48 *
49 * @since 3.2
50 * @version 1.0
51 */
52interface IExecutor {
53    /**
54     * @brief Get executor info.
55     *
56     * @param executorInfo Indicates executor info, see {@link ExecutorInfo}.
57     *
58     * @return Returns <b>0</b> if the operation is successful.
59     * @return Returns a non-zero value if the operation fails.
60     */
61    GetExecutorInfo([out] struct ExecutorInfo executorInfo);
62    /**
63     * @brief Get template info.
64     *
65     * @param templateId Indicates template id.
66     * @param templateInfo Indicates template info, see {@link TemplateInfo}.
67     *
68     * @return Returns <b>0</b> if the operation is successful.
69     * @return Returns a non-zero value if the operation fails.
70     */
71    GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo templateInfo);
72    /**
73     * @brief Send parameters to driver when executor register finish.
74     *
75     * @param templateIdList Indicates templates previously registered to userauth framework.
76     * @param frameworkPublicKey Indicates framework public key.
77     * @param extraInfo Indicates extra info send to executor.
78     *
79     * @return Returns <b>0</b> if the operation is successful.
80     * @return Returns a non-zero value if the operation fails.
81     */
82    OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo);
83    /**
84     * @brief Enroll template.
85     *
86     * @param scheduleId Indicates schedule id of enroll.
87     * @param extraInfo Indicates extra info of enroll.
88     * @param callbackObj Indicates enroll callback object, see {@link IExecutorCallback}.
89     *
90     * @return Returns <b>0</b> if the operation is successful.
91     * @return Returns a non-zero value if the operation fails.
92     */
93    Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
94    /**
95     * @brief Authenticate template.
96     *
97     * @param scheduleId Indicates schedule id of authenticate.
98     * @param templateIdList Indicates the templates to authenticate.
99     * @param extraInfo Indicates extra info of authenticate.
100     * @param callbackObj Indicates authenticate callback object, see {@link IExecutorCallback}.
101     *
102     * @return Returns <b>0</b> if the operation is successful.
103     * @return Returns a non-zero value if the operation fails.
104     */
105    Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
106    /**
107     * @brief Identify template.
108     *
109     * @param scheduleId Indicates schedule id of identify.
110     * @param extraInfo Indicates extra info of identify.
111     * @param callbackObj Indicates identify callback object, see {@link IExecutorCallback}.
112     *
113     * @return Returns <b>0</b> if the operation is successful.
114     * @return Returns a non-zero value if the operation fails.
115     */
116    Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
117    /**
118     * @brief Delete templates.
119     *
120     * @param templateIdList Indicates the templates to delete.
121     *
122     * @return Returns <b>0</b> if the operation is successful.
123     * @return Returns a non-zero value if the operation fails.
124     */
125    Delete([in] unsigned long[] templateIdList);
126    /**
127     * @brief Cancel enroll, authenticate or identify operation.
128     *
129     * @param scheduleId Indicates schedule id of operation to cancel.
130     *
131     * @return Returns <b>0</b> if the operation is successful.
132     * @return Returns a non-zero value if the operation fails.
133     */
134    Cancel([in] unsigned long scheduleId);
135    /**
136     * @brief Send command to driver.
137     *
138     * @param commandId Indicates command id. For details, see {@link CommandId}.
139     * @param extraInfo Indicates extra info of command.
140     * @param callbackObj Indicates command callback object, see {@link IExecutorCallback}.
141     *
142     * @return Returns <b>0</b> if the operation is successful.
143     * @return Returns a non-zero value if the operation fails.
144     */
145    SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj);
146    /**
147     * @brief Set buffer producer.
148     *
149     * @param bufferProducer Indicates bufferProducer set to executor.
150     *
151     * @return Returns <b>0</b> if the operation is successful.
152     * @return Returns a non-zero value if the operation fails.
153     */
154    SetBufferProducer([in] BufferProducerSequenceable bufferProducer);
155}