diff --git a/face_auth/bundle.json b/face_auth/bundle.json index 32636e0f5af401e2955513a4b27aca961392b63e..e5993793e7fbd3371651446bd4ec86cacdf8d60b 100644 --- a/face_auth/bundle.json +++ b/face_auth/bundle.json @@ -28,14 +28,13 @@ }, "build": { "sub_component": [ - "//drivers/interface/face_auth/v1_0:face_auth_idl_target", - "//drivers/interface/face_auth/v1_1:face_auth_idl_target" + "//drivers/interface/face_auth/v2_0:face_auth_idl_target" ], "test": [ ], "inner_kits": [ { - "name": "//drivers/interface/face_auth/v1_0:libface_auth_proxy_1.0", + "name": "//drivers/interface/face_auth/v2_0:libface_auth_proxy_2.0", "header": { "header_files": [ ], @@ -43,7 +42,7 @@ } }, { - "name": "//drivers/interface/face_auth/v1_0:libface_auth_stub_1.0", + "name": "//drivers/interface/face_auth/v2_0:libface_auth_stub_2.0", "header": { "header_files": [ ], @@ -51,31 +50,7 @@ } }, { - "name": "//drivers/interface/face_auth/v1_0:face_auth_idl_headers", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/face_auth" - } - }, - { - "name": "//drivers/interface/face_auth/v1_1:libface_auth_proxy_1.1", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/face_auth" - } - }, - { - "name": "//drivers/interface/face_auth/v1_1:libface_auth_stub_1.1", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/face_auth" - } - }, - { - "name": "//drivers/interface/face_auth/v1_1:face_auth_idl_headers", + "name": "//drivers/interface/face_auth/v2_0:face_auth_idl_headers_2.0", "header": { "header_files": [ ], diff --git a/face_auth/v1_0/FaceAuthTypes.idl b/face_auth/v1_0/FaceAuthTypes.idl index 10d30c299b48df5dc977225b4b9dc65c2db246e8..22f9a416a6e6be69c797d93d3709730db349e8d3 100644 --- a/face_auth/v1_0/FaceAuthTypes.idl +++ b/face_auth/v1_0/FaceAuthTypes.idl @@ -85,20 +85,6 @@ enum ExecutorSecureLevel : int { ESL3 = 3, }; -/** - * @brief Enumerates command IDs. - * - * @since 3.2 - * @version 1.0 - */ -enum CommandId : int { - /**< Indicates the command ID for locking the template. */ - LOCK_TEMPLATE = 1, - /**< Indicates the command ID for unlocking the template. */ - UNLOCK_TEMPLATE = 2, - /**< The vendor may add a custom command ID after this. */ - VENDOR_COMMAND_BEGIN = 10000 -}; /** * @brief Enumerates prompt codes. @@ -174,4 +160,19 @@ struct TemplateInfo { /**< Indicates extra information. */ unsigned char[] extraInfo; }; + +/** + * @brief Enumerates command IDs. + * + * @since 3.2 + * @version 1.0 + */ +enum CommandId : int { + /**< Indicates the command ID for locking the template. */ + LOCK_TEMPLATE = 1, + /**< Indicates the command ID for unlocking the template. */ + UNLOCK_TEMPLATE = 2, + /**< The vendor may add a custom command ID after this. */ + VENDOR_COMMAND_BEGIN = 10000 +}; /** @} */ \ No newline at end of file diff --git a/face_auth/v2_0/BUILD.gn b/face_auth/v2_0/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..01500c37e5caedd628618f913ee06ad41a30bad3 --- /dev/null +++ b/face_auth/v2_0/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +hdi("face_auth") { + module_name = "drivers_peripheral_face_auth" + sources = [ + "FaceAuthTypes.idl", + "IAllInOneExecutor.idl", + "IExecutorCallback.idl", + "IFaceAuthInterface.idl", + "ISaCommandCallback.idl", + ] + sequenceable_ext_deps = [ + "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", + "graphic_surface:surface", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_face_auth" +} diff --git a/face_auth/v2_0/FaceAuthTypes.idl b/face_auth/v2_0/FaceAuthTypes.idl new file mode 100755 index 0000000000000000000000000000000000000000..b102db0057a8e065784a572ca2ad18100717d18e --- /dev/null +++ b/face_auth/v2_0/FaceAuthTypes.idl @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFaceAuth + * @{ + * + * @brief Provides APIs for the face auth driver. + * + * The face auth driver provides a unified interface for the face auth service to access the face auth driver. + * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the face auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + */ + +/** + * @file FaceAuthTypes.idl + * + * @brief Defines the enumeration and data structure of the face auth driver, including AuthType, ExecutorRole, ExecutorSecureLevel, + * CommandId, FaceTipsCode, ExecutorInfo, and TemplateInfo. + * + * @since 3.2 + */ + +package ohos.hdi.face_auth.v2_0; + +/** + * @brief Enumerates credential types for authentication. + * + * @since 3.2 + * @version 1.0 + */ +enum AuthType : int { + /**< Indicates that the authentication type is PIN. */ + PIN = 1, + /**< Indicates that the authentication type is face. */ + FACE = 2, + /**< Indicates that the authentication type is fingerprint. */ + FINGERPRINT = 4, +}; + +/** + * @brief Enumerates executor roles. + * + * @since 3.2 + * @version 2.0 + */ +enum ExecutorRole : int { + /**< Indicates that the executor role is scheduler. */ + SCHEDULER = 0, + /**< Indicates that the executor role is collector. */ + COLLECTOR = 1, + /**< Indicates that the executor role is verifier. */ + VERIFIER = 2, + /**< Indicates that the executor role is the combination of collector and verifier. */ + ALL_IN_ONE = 3, +}; + +/** + * @brief Enumerates executor secure levels. + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /**< Indicates that the executor secure level is ESL0. */ + ESL0 = 0, + /**< Indicates that the executor secure level is ESL1. */ + ESL1 = 1, + /**< Indicates that the executor secure level is ESL2. */ + ESL2 = 2, + /**< Indicates that the executor secure level is ESL3. */ + ESL3 = 3, +}; + +/** + * @brief Enumerates authentication capability levels. + * + * @since 5.0 + * @version 1.0 + */ +enum AuthenticationCapabilityLevel : int { + /**< Indicates that the authentication capability level is ACL0. */ + ATL0 = 0, + /**< Indicates that the authentication capability level is ACL1. */ + ATL1 = 10000, + /**< Indicates that the authentication capability level is ACL2. */ + ATL2 = 20000, + /**< Indicates that the authentication capability level is ACL3. */ + ATL3 = 30000, + /**< Indicates that the authentication capability level is ACL4. */ + ATL4 = 40000, +}; + +/** + * @brief Indicates executor information. + * + * @since 3.2 + * @version 2.0 + */ +struct ExecutorInfo { + /**< Indicates the sensor ID, which must be unique within the driver. */ + unsigned short sensorId; + /**< Indicates the executor matcher. */ + unsigned int executorMatcher; + /**< Indicates the max acl of template. See @{AuthenticationCapabilityLevel}. */ + unsigned int maxTemplateAcl; + /**< Indicates the executor role. See @{ExecutorRole}. */ + int executorRole; + /**< Indicates the auth type. See @{AuthType}. */ + int authType; + /**< Indicates the executor secure level. See @{ExecutorSecureLevel}. */ + int esl; + /**< Indicates the public key of the executor. */ + unsigned char[] publicKey; + /**< Indicates extra information. */ + unsigned char[] extraInfo; +}; + +/** + * @brief Enumerates prompt codes. + * + * @since 3.2 + * @version 1.0 + */ +enum FaceTipsCode : int { + /**< Indicates that the obtained facial image is too bright due to high illumination. */ + FACE_AUTH_TIP_TOO_BRIGHT = 1, + /**< Indicates that the obtained facial image is too dark due to low illumination. */ + FACE_AUTH_TIP_TOO_DARK = 2, + /**< Indicates that the face is too close to the device. */ + FACE_AUTH_TIP_TOO_CLOSE = 3, + /**< Indicates that the face is too far away from the device. */ + FACE_AUTH_TIP_TOO_FAR = 4, + /**< Indicates that the device is too high, and that only the upper part of the face is captured. */ + FACE_AUTH_TIP_TOO_HIGH = 5, + /**< Indicates that the device is too low, and that only the lower part of the face is captured. */ + FACE_AUTH_TIP_TOO_LOW = 6, + /**< Indicates that the device is deviated to the right, and that only the right part of the face is captured. */ + FACE_AUTH_TIP_TOO_RIGHT = 7, + /**< Indicates that the device is deviated to the left, and that only the left part of the face is captured. */ + FACE_AUTH_TIP_TOO_LEFT = 8, + /**< Indicates that the face moves too much during facial information collection. */ + FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, + /**< Indicates that the user is not gazing at the device. */ + FACE_AUTH_TIP_POOR_GAZE = 10, + /**< Indicates that no face is detected. */ + FACE_AUTH_TIP_NOT_DETECTED = 11, + /**< The vendor may add a custom face auth tip after this. */ + VENDOR_FACE_AUTH_TIP_BEGIN = 10000 +}; + +/** + * @brief Enumerates get Property types. + * + * @since 4.0 + * @version 1.1 + */ +enum GetPropertyType : int { + /**< Indicates that the property to get is auth sub type. */ + AUTH_SUB_TYPE = 1, + /**< Indicates that the property to get is lockout duration. */ + LOCKOUT_DURATION = 2, + /**< Indicates that the property to get is remain attempts. */ + REMAIN_ATTEMPTS = 3, + /**< Indicates that the property to get is enroll progress. */ + ENROLL_PROGRESS = 4, + /**< Indicates that the property to get is sensor info. */ + SENSOR_INFO = 5 +}; + +/** + * @brief Indicates executor property. + * + * @since 4.0 + * @version 1.1 + */ +struct Property { + /**< Indicates auth sub type. */ + unsigned long authSubType; + /**< Indicates lockout duration. */ + int lockoutDuration; + /**< Indicates remain attempts. */ + int remainAttempts; + /**< Indicates enroll progress. */ + String enrollmentProgress; + /**< Indicates sensor info. */ + String sensorInfo; +}; + +/** + * @brief Enumerates sa command ids. + * + * @since 4.0 + * @version 1.1 + */ +enum SaCommandId : int { + /**< Indicates that the sa command is begin brightness increase. */ + BEGIN_SCREEN_BRIGHTNESS_INCREASE = 1, + /**< Indicates that the sa command is end brightness increase. */ + END_SCREEN_BRIGHTNESS_INCREASE = 2, +}; + +/** + * @brief Indicates sa command parameter none. + * + * @since 4.0 + * @version 1.1 + */ +struct SaCommandParamNone { +}; + +/** + * @brief Indicates sa command parameter. + * + * @since 4.0 + * @version 1.1 + */ +union SaCommandParam { + /**< Indicates that sa command parameter is none. See {@link SaCommandParamNone}. */ + struct SaCommandParamNone none; +}; + +/** + * @brief Indicates sa command. + * + * @since 4.0 + * @version 2.0 + */ +struct SaCommand { + /**< Indicates sa command id. See {@link SaCommandId}. */ + int id; + /**< Indicates sa command parameter. See {@link SaCommandParam}. */ + union SaCommandParam param; +}; + +/** + * @brief Enumerates command IDs. + * + * @since 4.0 + * @version 1.1 + */ +enum CommandId : int { + /**< Indicates the command ID for locking the template. */ + LOCK_TEMPLATE = 1, + /**< Indicates the command ID for unlocking the template. */ + UNLOCK_TEMPLATE = 2, + /**< Indicates the command ID for init algorithm. */ + INIT_ALGORITHM = 3, + /**< The vendor may add a custom command ID after this. */ + VENDOR_COMMAND_BEGIN = 10000 +}; +/** @} */ \ No newline at end of file diff --git a/face_auth/v2_0/IAllInOneExecutor.idl b/face_auth/v2_0/IAllInOneExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..afce28fddcf4172eedb5f9542acd8b98e6eb8882 --- /dev/null +++ b/face_auth/v2_0/IAllInOneExecutor.idl @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFaceAuth + * @{ + * + * @brief Provides APIs for the face auth driver. + * + * The face auth driver provides a unified interface for the face auth service to access the face auth driver. + * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the face auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + */ + +/** + * @file IAllInOneExecutor.idl + * + * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + */ + +package ohos.hdi.face_auth.v2_0; + +import ohos.hdi.face_auth.v2_0.FaceAuthTypes; +import ohos.hdi.face_auth.v2_0.IExecutorCallback; +import ohos.hdi.face_auth.v2_0.ISaCommandCallback; + +/** + * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.0 + */ +interface IAllInOneExecutor { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); + /** + * @brief Cancels the enrollment, authentication, or identification operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Enrolls templates. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param extraInfo Indicates the extra information of enrollment. + * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Authenticates templates. + * + * @param scheduleId Indicates the schedule ID of authentication. + * @param templateIdList Indicates the templates to authenticate. + * @param extraInfo Indicates the extra information of authentication. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Identifies templates. + * + * @param scheduleId Indicates the schedule ID of identification. + * @param extraInfo Indicates the extra information of identification. + * @param callbackObj Indicates the callback object of identification. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Deletes templates. + * + * @param templateIdList Indicates the templates to delete. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Delete([in] unsigned long[] templateIdList); + /** + * @brief Sends a command to the driver. + * + * @param commandId Indicates the command ID. See {@link CommandId}. + * @param extraInfo Indicates the extra information of the command. + * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Get property. + * + * @param templateIdList Indicates the templates to process. + * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}. + * @param property Indicates property. See {@link Property}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); + /** + * @brief Set cached templates. + * + * @param templateIdList Indicates the templates to cache. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + SetCachedTemplates([in] unsigned long[] templateIdList); + /** + * @brief Register sa command callback. + * + * @param callbackObj Indicates the sa command callback. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + RegisterSaCommandCallback([in] ISaCommandCallback callbackObj); +} +/** @} */ \ No newline at end of file diff --git a/face_auth/v2_0/IExecutorCallback.idl b/face_auth/v2_0/IExecutorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..c1a97c7b6e57607253ca7b189be18b3a9949e971 --- /dev/null +++ b/face_auth/v2_0/IExecutorCallback.idl @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFaceAuth + * @{ + * + * @brief Provides APIs for the face auth driver. + * + * The face auth driver provides a unified interface for the face auth service to access the face auth driver. + * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the face auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + */ + +/** + * @file IExecutorCallback.idl + * + * @brief Defines the callback for an async API, which can be used to report operation results or information + * of the async API. + * + * @since 3.2 + */ + +package ohos.hdi.face_auth.v2_0; + +/** + * @brief Defines the callback for an async API, which can be used to report operation results or information + * of the async API. + * + * @since 3.2 + * @version 2.0 + */ +[callback] interface IExecutorCallback { + /** + * @brief Defines the function for reporting operation results. + * + * @param result Indicates the result code. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + OnResult([in] int result, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for reporting information in process. + * + * @param tip Indicates tip code. See {@link FaceTipsCode}. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for reporting message. + * + * @param destRole is the role of destination. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnMessage([in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/face_auth/v2_0/IFaceAuthInterface.idl b/face_auth/v2_0/IFaceAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..aed00dc94e82976c1f8b55a4668ebd4ce611d866 --- /dev/null +++ b/face_auth/v2_0/IFaceAuthInterface.idl @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFaceAuth + * @{ + * + * @brief Provides APIs for the face auth driver. + * + * The face auth driver provides a unified interface for the face auth service to access the face auth driver. + * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the face auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + */ + +/** + * @file IFaceAuthInterface.idl + * + * @brief Defines the API for getting the executor list of the face auth driver. + * + * @since 3.2 + */ + +package ohos.hdi.face_auth.v2_0; + +import ohos.hdi.face_auth.v2_0.IAllInOneExecutor; +sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable; + +/** + * @brief Defines the API for getting the executor list of the face auth driver. + * + * @since 3.2 + * @version 2.0 + */ +interface IFaceAuthInterface { + /** + * @brief Obtains the executor list of the driver. + * + * @param allInOneExecutors Indicates the all-in-one executor list of the driver. + * See {@link IAllInOneExecutor}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetExecutorList([out] IAllInOneExecutor[] allInOneExecutors); + /** + * @brief Set buffer producer. + * + * @param bufferProducer Indicates bufferProducer set to executor. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + SetBufferProducer([in] BufferProducerSequenceable bufferProducer); +} +/** @} */ \ No newline at end of file diff --git a/face_auth/v2_0/ISaCommandCallback.idl b/face_auth/v2_0/ISaCommandCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..c5e615d566354d9ae316a9a3c98d506af35581fd --- /dev/null +++ b/face_auth/v2_0/ISaCommandCallback.idl @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFaceAuth + * @{ + * + * @brief Provides APIs for the face auth driver. + * + * The face auth driver provides a unified interface for the face auth service to access the face auth driver. + * After obtaining the face auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the face auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 4.0 + */ + +/** + * @file ISaCommandCallback.idl + * + * @brief Defines the callback for an async API, which can be used to send command to SA. + * + * @since 4.0 + */ + +package ohos.hdi.face_auth.v2_0; + +import ohos.hdi.face_auth.v2_0.FaceAuthTypes; + +/** + * @brief Defines the callback for an async API, which can be used to send command to SA. + * + * @since 4.0 + * @version 1.1 + */ +[callback] interface ISaCommandCallback { + /** + * @brief Defines the function for sa commands in process. + * + * @param commands Indicates sa commands. See {@link SaCommand}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 4.0 + * @version 1.1 + */ + OnSaCommands([in] struct SaCommand[] commands); +} +/** @} */ \ No newline at end of file diff --git a/fingerprint_auth/bundle.json b/fingerprint_auth/bundle.json index c490401c5d55fa385af6e445cf2dd924ab924b4f..36216e7c71f536e0a9cda809fade38bb1c2fae38 100644 --- a/fingerprint_auth/bundle.json +++ b/fingerprint_auth/bundle.json @@ -26,14 +26,13 @@ }, "build": { "sub_component": [ - "//drivers/interface/fingerprint_auth/v1_0:fingerprint_auth_idl_target", - "//drivers/interface/fingerprint_auth/v1_2:fingerprint_auth_idl_target" + "//drivers/interface/fingerprint_auth/v2_0:fingerprint_auth_idl_target" ], "test": [ ], "inner_kits": [ { - "name": "//drivers/interface/fingerprint_auth/v1_0:libfingerprint_auth_proxy_1.0", + "name": "//drivers/interface/fingerprint_auth/v2_0:libfingerprint_auth_proxy_2.0", "header": { "header_files": [ ], @@ -41,7 +40,7 @@ } }, { - "name": "//drivers/interface/fingerprint_auth/v1_0:libfingerprint_auth_stub_1.0", + "name": "//drivers/interface/fingerprint_auth/v2_0:libfingerprint_auth_stub_2.0", "header": { "header_files": [ ], @@ -49,31 +48,7 @@ } }, { - "name": "//drivers/interface/fingerprint_auth/v1_0:fingerprint_auth_idl_headers_1.0", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/fingerprint_auth" - } - }, - { - "name": "//drivers/interface/fingerprint_auth/v1_2:libfingerprint_auth_proxy_1.2", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/fingerprint_auth" - } - }, - { - "name": "//drivers/interface/fingerprint_auth/v1_2:libfingerprint_auth_stub_1.2", - "header": { - "header_files": [ - ], - "header_base": "//drivers/interface/fingerprint_auth" - } - }, - { - "name": "//drivers/interface/fingerprint_auth/v1_2:fingerprint_auth_idl_headers_1.2", + "name": "//drivers/interface/fingerprint_auth/v2_0:fingerprint_auth_idl_headers_2.0", "header": { "header_files": [ ], diff --git a/fingerprint_auth/v2_0/BUILD.gn b/fingerprint_auth/v2_0/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c722efe9963c2dc56005f248a1f67d507fd53a9b --- /dev/null +++ b/fingerprint_auth/v2_0/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +hdi("fingerprint_auth") { + module_name = "drivers_peripheral_fingerprint_auth" + sources = [ + "FingerprintAuthTypes.idl", + "IAllInOneExecutor.idl", + "IExecutorCallback.idl", + "IFingerprintAuthInterface.idl", + "ISaCommandCallback.idl", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_fingerprint_auth" +} diff --git a/fingerprint_auth/v2_0/FingerprintAuthTypes.idl b/fingerprint_auth/v2_0/FingerprintAuthTypes.idl new file mode 100755 index 0000000000000000000000000000000000000000..beb5563d698a3c7638055de31289306a6a64492d --- /dev/null +++ b/fingerprint_auth/v2_0/FingerprintAuthTypes.idl @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFingerprintAuth + * @{ + * + * @brief Provides APIs for the fingerprint auth driver. + * + * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver. + * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the fingerprint auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + */ + +/** + * @file FingerprintAuthTypes.idl + * + * @brief Defines the enumeration and data structure of the fingerprint auth driver, including AuthType, ExecutorRole, ExecutorSecureLevel, + * CommandId, FaceTipsCode, ExecutorInfo, and TemplateInfo. + * + * @since 3.2 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +/** + * @brief Enumerates credential types for authentication. + * + * @since 3.2 + * @version 1.0 + */ +enum AuthType : int { + /**< Indicates that the authentication type is PIN. */ + PIN = 1, + /**< Indicates that the authentication type is face. */ + FACE = 2, + /**< Indicates that the authentication type is fingerprint. */ + FINGERPRINT = 4, +}; + +/** + * @brief Enumerates executor roles. + * + * @since 3.2 + * @version 2.0 + */ +enum ExecutorRole : int { + /**< Indicates that the executor role is scheduler. */ + SCHEDULER = 0, + /**< Indicates that the executor role is collector. */ + COLLECTOR = 1, + /**< Indicates that the executor role is verifier. */ + VERIFIER = 2, + /**< Indicates that the executor role is the combination of collector and verifier. */ + ALL_IN_ONE = 3, +}; + +/** + * @brief Enumerates executor secure levels. + * + * @since 3.2 + * @version 1.0 + */ +enum ExecutorSecureLevel : int { + /**< Indicates that the executor secure level is ESL0. */ + ESL0 = 0, + /**< Indicates that the executor secure level is ESL1. */ + ESL1 = 1, + /**< Indicates that the executor secure level is ESL2. */ + ESL2 = 2, + /**< Indicates that the executor secure level is ESL3. */ + ESL3 = 3, +}; + +/** + * @brief Enumerates authentication capability levels. + * + * @since 5.0 + * @version 1.0 + */ +enum AuthenticationCapabilityLevel : int { + /**< Indicates that the authentication capability level is ACL0. */ + ATL0 = 0, + /**< Indicates that the authentication capability level is ACL1. */ + ATL1 = 10000, + /**< Indicates that the authentication capability level is ACL2. */ + ATL2 = 20000, + /**< Indicates that the authentication capability level is ACL3. */ + ATL3 = 30000, + /**< Indicates that the authentication capability level is ACL4. */ + ATL4 = 40000, +}; + +/** + * @brief Indicates executor information. + * + * @since 3.2 + * @version 2.0 + */ +struct ExecutorInfo { + /**< Indicates the sensor ID, which must be unique within the driver. */ + unsigned short sensorId; + /**< Indicates the executor matcher. */ + unsigned int executorMatcher; + /**< Indicates the max acl of template. See @{AuthenticationCapabilityLevel}. */ + unsigned int maxTemplateAcl; + /**< Indicates the executor role. See @{ExecutorRole}. */ + int executorRole; + /**< Indicates the auth type. See @{AuthType}. */ + int authType; + /**< Indicates the executor secure level. See @{ExecutorSecureLevel}. */ + int esl; + /**< Indicates the public key of the executor. */ + unsigned char[] publicKey; + /**< Indicates extra information. */ + unsigned char[] extraInfo; +}; + +/** + * @brief Enumerates prompt codes. + * + * @since 3.2 + * @version 1.2 + */ +enum FingerprintTipsCode : int { + /**< Indicates that the image acquired is good. */ + FINGERPRINT_AUTH_TIP_GOOD = 0, + /**< Indicates that the fingerprint image is too noisy due to suspected or detected dirt on sensor. */ + FINGERPRINT_AUTH_TIP_DIRTY = 1, + /**< Indicates that only a partial fingerprint image is detected. */ + FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2, + /**< Indicates that only a partial fingerprint image is detected. */ + FINGERPRINT_AUTH_TIP_PARTIAL = 3, + /**< Indicates that the fingerprint image is incomplete due to quick motion. */ + FINGERPRINT_AUTH_TIP_TOO_FAST = 4, + /**< Indicates that the fingerprint image is unreadable due to lack of motion. */ + FINGERPRINT_AUTH_TIP_TOO_SLOW = 5, + /**< Indicates that the finger is down. */ + FINGERPRINT_AUTH_TIP_FINGER_DOWN = 6, + /**< Indicates that the finger is up. */ + FINGERPRINT_AUTH_TIP_FINGER_UP = 7, + /**< Indicates that a single auth result. The authentication result is carried in a json + character string: {"authResult":1,"authRemainAttempts":3,"lockoutDuration":0} */ + FINGERPRINT_AUTH_TIP_SINGLE_AUTH_RESULT = 8, + /**< The vendor may add a custom fingerprint auth tip after this. */ + VENDOR_FINGERPRINT_AUTH_TIP_BEGIN = 10000 +}; + +/** + * @brief Enumerates get Property types. + * + * @since 4.0 + * @version 1.1 + */ +enum GetPropertyType : int { + /**< Indicates that the property to get is auth sub type. */ + AUTH_SUB_TYPE = 1, + /**< Indicates that the property to get is lockout duration. */ + LOCKOUT_DURATION = 2, + /**< Indicates that the property to get is remain attempts. */ + REMAIN_ATTEMPTS = 3, + /**< Indicates that the property to get is enroll progress. */ + ENROLL_PROGRESS = 4, + /**< Indicates that the property to get is sensor info. */ + SENSOR_INFO = 5 +}; + +/** + * @brief Indicates executor property. + * + * @since 4.0 + * @version 1.1 + */ +struct Property { + /**< Indicates auth sub type. */ + unsigned long authSubType; + /**< Indicates lockout duration. */ + int lockoutDuration; + /**< Indicates remain attempts. */ + int remainAttempts; + /**< Indicates enroll progress. */ + String enrollmentProgress; + /**< Indicates sensor info. */ + String sensorInfo; +}; + +/** + * @brief Enumerates sa command ids. + * + * @since 4.0 + * @version 1.1 + */ +enum SaCommandId : int { + /**< Indicates that the sa command is enable sensor illumination. */ + ENABLE_SENSOR_ILLUMINATION = 1, + /**< Indicates that the sa command is disable sensor illumination. */ + DISABLE_SENSOR_ILLUMINATION = 2, + /**< Indicates that the sa command is turn on sensor illumination. */ + TURN_ON_SENSOR_ILLUMINATION = 3, + /**< Indicates that the sa command is turn off sensor illumination. */ + TURN_OFF_SENSOR_ILLUMINATION = 4, +}; + +/** + * @brief Sa command parameter for enable sensor illumination. + * + * @since 4.0 + * @version 1.1 + */ +struct SaCommandParamEnableSensorIllumination { + /**< Indicates that highlight circle center x-coordinate per thousand to screen width. */ + unsigned int centerX; + /**< Indicates that highlight circle center y-coordinate per thousand to screen height. */ + unsigned int centerY; + /**< Indicates that highlight circle radius, in px. */ + unsigned int radius; + /**< Indicates that highlight brightness. */ + unsigned int brightness; + /**< Indicates that highlight color. */ + unsigned int color; +}; + +/** + * @brief Indicates sa command parameter none. + * + * @since 4.0 + * @version 1.1 + */ +struct SaCommandParamNone { +}; + +/** + * @brief Indicates sa command parameter. + * + * @since 4.0 + * @version 1.1 + */ +union SaCommandParam { + /**< Indicates that sa command parameter is none. See {@link SaCommandParamNone}. */ + struct SaCommandParamNone none; + /**< Indicates that sa command parameter is enable sensor illumination. See {@link SaCommandParamEnableSensorIllumination}. */ + struct SaCommandParamEnableSensorIllumination enableSensorIllumination; +}; + +/** + * @brief Indicates sa command. + * + * @since 4.0 + * @version 2.0 + */ +struct SaCommand { + /**< Indicates sa command id. See {@link SaCommandId}. */ + int id; + /**< Indicates sa command parameter. See {@link SaCommandParam}. */ + union SaCommandParam param; +}; + +/** + * @brief Enumerates command IDs. + * + * @since 4.0 + * @version 1.1 + */ +enum CommandId : int { + /**< Indicates the command ID for locking the template. */ + LOCK_TEMPLATE = 1, + /**< Indicates the command ID for unlocking the template. */ + UNLOCK_TEMPLATE = 2, + /**< Indicates the command ID for init algorithm. */ + INIT_ALGORITHM = 3, + /**< The vendor may add a custom command ID after this. */ + VENDOR_COMMAND_BEGIN = 10000 +}; +/** @} */ \ No newline at end of file diff --git a/fingerprint_auth/v2_0/IAllInOneExecutor.idl b/fingerprint_auth/v2_0/IAllInOneExecutor.idl new file mode 100755 index 0000000000000000000000000000000000000000..40e843d813bb14ceab253158c385670a891e9d90 --- /dev/null +++ b/fingerprint_auth/v2_0/IAllInOneExecutor.idl @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFingerprintAuth + * @{ + * + * @brief Provides APIs for the fingerprint auth driver. + * + * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver. + * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the fingerprint auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + */ + +/** + * @file IAllInOneExecutor.idl + * + * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +import ohos.hdi.fingerprint_auth.v2_0.FingerprintAuthTypes; +import ohos.hdi.fingerprint_auth.v2_0.IExecutorCallback; +import ohos.hdi.fingerprint_auth.v2_0.ISaCommandCallback; + +/** + * @brief Defines the APIs of the executors. These APIs can be used to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 5.0 + * @version 1.0 + */ +interface IAllInOneExecutor { + /** + * @brief Gets executor information. + * + * @param executorInfo Indicates executor information. See {@link ExecutorInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + GetExecutorInfo([out] struct ExecutorInfo executorInfo); + /** + * @brief Sends parameters to the driver when executor registration is finished. + * + * @param templateIdList Indicates the templates previously registered to the user auth framework. + * @param frameworkPublicKey Indicates the framework public key. + * @param extraInfo Indicates the extra information that is sent to the executors. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo); + /** + * @brief Cancels the enrollment, authentication, or identification operation. + * + * @param scheduleId Indicates the schedule ID of the operation to cancel. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Cancel([in] unsigned long scheduleId); + /** + * @brief Send message. + * + * @param scheduleId Indicates the schedule ID of the message. + * @param srcRole is the role of source. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg); + /** + * @brief Enrolls templates. + * + * @param scheduleId Indicates the schedule ID of enrollment. + * @param extraInfo Indicates the extra information of enrollment. + * @param callbackObj Indicates the callback object of enrollment. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Enroll([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Authenticates templates. + * + * @param scheduleId Indicates the schedule ID of authentication. + * @param templateIdList Indicates the templates to authenticate. + * @param endAfterFirstFail Indicates end authentication after the first authentication failure. + * @param extraInfo Indicates the extra information of authentication. + * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] boolean endAfterFirstFail, + [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Identifies templates. + * + * @param scheduleId Indicates the schedule ID of identification. + * @param extraInfo Indicates the extra information of identification. + * @param callbackObj Indicates the callback object of identification. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Identify([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Deletes templates. + * + * @param templateIdList Indicates the templates to delete. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + Delete([in] unsigned long[] templateIdList); + /** + * @brief Sends a command to the driver. + * + * @param commandId Indicates the command ID. See {@link CommandId}. + * @param extraInfo Indicates the extra information of the command. + * @param callbackObj Indicates the callback object of the command. See {@link IExecutorCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + SendCommand([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj); + /** + * @brief Get property. + * + * @param templateIdList Indicates the templates to process. + * @param propertyTypes Indicates the property types to get. See {@link GetPropertyType}. + * @param property Indicates property. See {@link Property}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + GetProperty([in] unsigned long[] templateIdList, [in] int[] propertyTypes, [out] struct Property property); + /** + * @brief Set cached templates. + * + * @param templateIdList Indicates the templates to cache. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + SetCachedTemplates([in] unsigned long[] templateIdList); + /** + * @brief Register sa command callback. + * + * @param callbackObj Indicates the sa command callback. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + RegisterSaCommandCallback([in] ISaCommandCallback callbackObj); +} +/** @} */ \ No newline at end of file diff --git a/fingerprint_auth/v2_0/IExecutorCallback.idl b/fingerprint_auth/v2_0/IExecutorCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..0a024da7eacfaa905f4c11becb29cc732b940f6b --- /dev/null +++ b/fingerprint_auth/v2_0/IExecutorCallback.idl @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFingerprintAuth + * @{ + * + * @brief Provides APIs for the fingerprint auth driver. + * + * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver. + * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the fingerprint auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + */ + +/** + * @file IExecutorCallback.idl + * + * @brief Defines the callback for an async API, which can be used to report operation results or information + * of the async API. + * + * @since 3.2 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +/** + * @brief Defines the callback for an async API, which can be used to report operation results or information + * of the async API. + * + * @since 3.2 + * @version 2.0 + */ +[callback] interface IExecutorCallback { + /** + * @brief Defines the function for reporting operation results. + * + * @param result Indicates the result code. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 1.0 + */ + OnResult([in] int result, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for reporting information in process. + * + * @param tip Indicates tip code. See {@link FaceTipsCode}. + * @param extraInfo Indicates extra information to report. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); + /** + * @brief Defines the function for reporting message. + * + * @param destRole is the role of destination. + * @param msg is the message content. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + OnMessage([in] int destRole, [in] unsigned char[] msg); +} +/** @} */ \ No newline at end of file diff --git a/fingerprint_auth/v2_0/IFingerprintAuthInterface.idl b/fingerprint_auth/v2_0/IFingerprintAuthInterface.idl new file mode 100755 index 0000000000000000000000000000000000000000..2b0fba024dac93bcccd7030fd3ecb63b952d46e0 --- /dev/null +++ b/fingerprint_auth/v2_0/IFingerprintAuthInterface.idl @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFingerprintAuth + * @{ + * + * @brief Provides APIs for the fingerprint auth driver. + * + * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver. + * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the fingerprint auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 3.2 + */ + +/** + * @file IFingerprintAuthInterface.idl + * + * @brief Defines the API for getting the executor list of the fingerprint auth driver. + * + * @since 3.2 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +import ohos.hdi.fingerprint_auth.v2_0.IAllInOneExecutor; + +/** + * @brief Defines the API for getting the executor list of the fingerprint auth driver. + * + * @since 3.2 + * @version 2.0 + */ +interface IFingerprintAuthInterface { + /** + * @brief Obtains the executor list of the driver. + * + * @param allInOneExecutors Indicates the all-in-one executor list of the driver. + * See {@link IAllInOneExecutor}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 3.2 + * @version 2.0 + */ + GetExecutorList([out] IAllInOneExecutor[] allInOneExecutors); +} +/** @} */ \ No newline at end of file diff --git a/fingerprint_auth/v2_0/ISaCommandCallback.idl b/fingerprint_auth/v2_0/ISaCommandCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..2495d4978a9f50801d487d7fe9b05d9089732cf4 --- /dev/null +++ b/fingerprint_auth/v2_0/ISaCommandCallback.idl @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup HdfFingerprintAuth + * @{ + * + * @brief Provides APIs for the fingerprint auth driver. + * + * The fingerprint auth driver provides a unified interface for the fingerprint auth service to access the fingerprint auth driver. + * After obtaining the fingerprint auth driver proxy, the service can call related APIs to obtain executors. + * After obtaining the fingerprint auth executors, the service can call related APIs to get executor information, get + * template information, and enroll, authenticate, and delete templates, etc. + * + * @since 4.0 + */ + +/** + * @file ISaCommandCallback.idl + * + * @brief Defines the callback for an async API, which can be used to send command to SA. + * + * @since 4.0 + */ + +package ohos.hdi.fingerprint_auth.v2_0; + +import ohos.hdi.fingerprint_auth.v2_0.FingerprintAuthTypes; + +/** + * @brief Defines the callback for an async API, which can be used to send command to SA. + * + * @since 4.0 + * @version 1.1 + */ +[callback] interface ISaCommandCallback { + /** + * @brief Defines the function for sa commands in process. + * + * @param commands Indicates sa commands. See {@link SaCommand}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 4.0 + * @version 1.1 + */ + OnSaCommands([in] struct SaCommand[] commands); +} +/** @} */ \ No newline at end of file