From 0af2d9823f7ea2bb13d7bf374f89aa265a08520f Mon Sep 17 00:00:00 2001 From: Tianshi Liu Date: Tue, 12 Apr 2022 19:52:12 +0800 Subject: [PATCH 1/6] update idl Change-Id: I1e2381f29ad61ee08710d9939f974db1bc5dd9f3 --- faceauth/v1_0/BUILD.gn | 32 ++++++++++++++++++++++++++++ faceauth/v1_0/IExecutor.idl | 20 +++++++++++++++++ faceauth/v1_0/IFaceAuthInterface.idl | 22 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 faceauth/v1_0/BUILD.gn create mode 100644 faceauth/v1_0/IExecutor.idl create mode 100644 faceauth/v1_0/IFaceAuthInterface.idl diff --git a/faceauth/v1_0/BUILD.gn b/faceauth/v1_0/BUILD.gn new file mode 100644 index 00000000..af26adae --- /dev/null +++ b/faceauth/v1_0/BUILD.gn @@ -0,0 +1,32 @@ +# Copyright (c) 2022 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/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libfaceauth_proxy_1.0") { + deps = [] + public_configs = [] + } +} else { + hdi("faceauth") { + module_name = "faceauth_interface_service" + + sources = [ + "IExecutor.idl", + "IFaceAuthInterface.idl", + ] + language = "cpp" + subsystem_name = "hdf" + part_name = "faceauth_device_driver" + } +} diff --git a/faceauth/v1_0/IExecutor.idl b/faceauth/v1_0/IExecutor.idl new file mode 100644 index 00000000..93f7a247 --- /dev/null +++ b/faceauth/v1_0/IExecutor.idl @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +interface IExecutor { + GetId([out] int id); +} diff --git a/faceauth/v1_0/IFaceAuthInterface.idl b/faceauth/v1_0/IFaceAuthInterface.idl new file mode 100644 index 00000000..2a1bdc9c --- /dev/null +++ b/faceauth/v1_0/IFaceAuthInterface.idl @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +import ohos.hdi.faceauth.v1_0.IExecutor; + +interface IFaceAuthInterface { + GetExecutorList([out] IExecutor [] executorList); +} -- Gitee From a425f7dc530ecc22363ad35dc22333e83bca41e9 Mon Sep 17 00:00:00 2001 From: Tianshi Liu Date: Sat, 16 Apr 2022 15:56:32 +0800 Subject: [PATCH 2/6] update idl Change-Id: I4a1bbbaa36883dec7d0232df6d8f7f179b041e71 --- userauth/IExecutor.idl | 31 ++++++++++++++++++ userauth/IExecutorCallback.idl | 21 +++++++++++++ userauth/Types.idl | 57 ++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 userauth/IExecutor.idl create mode 100644 userauth/IExecutorCallback.idl create mode 100644 userauth/Types.idl diff --git a/userauth/IExecutor.idl b/userauth/IExecutor.idl new file mode 100644 index 00000000..c6bb4a6b --- /dev/null +++ b/userauth/IExecutor.idl @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +import ohos.hdi.userauth.v1_0.Types; +import ohos.hdi.userauth.v1_0.IExecutorCallback; + +full interface IExecutor { + GetExecutorInfo([out] ExecutorInfo info); + GetTemplateInfo([in] unsigned long templateId, [out] TemplateInfo info); + onRegisterFinish([in] unsigned long templateIdList, [in] byte[] frameworkPublicKey, [in] byte[] extraInfo); + Enroll([in] int scheduleId, [in] byte[] extraInfo, [in] IExecutorCallback callback) + Authenticate([in] int scheduleId, [in] unsigned long templateIdList, [in] byte[] extraInfo, [in] IExecutorCallback callback); + Identify([in] int scheduleId, [in] byte[] extraInfo, [in] IExecutorCallback callback); + Delete([in] unsigned long[] templateIdList); + Cancel([in] int scheduleId); + SendCommand([in] CommandId CommandId, [in] byte[] extraInfo, [in] IExecutorCallback callback); +} \ No newline at end of file diff --git a/userauth/IExecutorCallback.idl b/userauth/IExecutorCallback.idl new file mode 100644 index 00000000..030519b3 --- /dev/null +++ b/userauth/IExecutorCallback.idl @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +[callback] full interface IExecutorCallback { + onResult([in] int code, [in] byte[] extraInfo); + onAcquireInfo([in] int code, [in] byte[] extraInfo); +} \ No newline at end of file diff --git a/userauth/Types.idl b/userauth/Types.idl new file mode 100644 index 00000000..f41f4ddb --- /dev/null +++ b/userauth/Types.idl @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +enum AuthType : unsigned int { + FACE, + FINGERPRINT +} + +enum ExecutorRole : unsigned int { + COLLECTOR, + VERIFIER, + ALL_IN_ONE +} + +enum ExecutorSecureLevel : unsigned int { + ESL0, + ESL1, + ESL2, + ESL3 +} + +enum CommandId : unsigned int { + LOCK_TEMPLATE = 0, + UNLOCK_TEMPLATE, + VENDOR_COMMAND_BEGIN = 10000 +} + +struct ExecutorInfo { + unsigned int sensorId; + unsigned int executorType; + ExecutorRole executorRole; + AuthType authType; + ExecutorSecureLevel esl; + byte[] publicKey; + byte[] extraInfo; +} + +struct TemplateInfo { + unsigned int executorType; + int freezingTime; + int remainTimes; + byte[] extraInfo; +} \ No newline at end of file -- Gitee From db09b0592bfe18ba4fbe231da90172b82cbfd34b Mon Sep 17 00:00:00 2001 From: Tianshi Liu Date: Sat, 16 Apr 2022 17:00:59 +0800 Subject: [PATCH 3/6] update idl Change-Id: I1396f0ebc47ee12837904df7925fa980d4587dd9 --- .../IFaceAuthExecutor.idl} | 7 +-- faceauth/v1_0/BUILD.gn | 43 +++++-------------- faceauth/v1_0/IFaceAuthExecutor.idl | 10 +++++ faceauth/v1_0/IFaceAuthInterface.idl | 8 ++-- userauth/v1_0/BUILD.gn | 13 ++++++ userauth/{ => v1_0}/IExecutor.idl | 18 ++++---- userauth/{ => v1_0}/IExecutorCallback.idl | 2 +- userauth/v1_0/IUserAuthInterface.idl | 22 ++++++++++ userauth/{ => v1_0}/Types.idl | 18 ++++---- 9 files changed, 83 insertions(+), 58 deletions(-) rename faceauth/{v1_0/IExecutor.idl => V1_0/IFaceAuthExecutor.idl} (85%) create mode 100644 faceauth/v1_0/IFaceAuthExecutor.idl create mode 100644 userauth/v1_0/BUILD.gn rename userauth/{ => v1_0}/IExecutor.idl (53%) rename userauth/{ => v1_0}/IExecutorCallback.idl (91%) create mode 100644 userauth/v1_0/IUserAuthInterface.idl rename userauth/{ => v1_0}/Types.idl (87%) diff --git a/faceauth/v1_0/IExecutor.idl b/faceauth/V1_0/IFaceAuthExecutor.idl similarity index 85% rename from faceauth/v1_0/IExecutor.idl rename to faceauth/V1_0/IFaceAuthExecutor.idl index 93f7a247..fcd136f7 100644 --- a/faceauth/v1_0/IExecutor.idl +++ b/faceauth/V1_0/IFaceAuthExecutor.idl @@ -15,6 +15,7 @@ package ohos.hdi.faceauth.v1_0; -interface IExecutor { - GetId([out] int id); -} +import ohos.hdi.userauth.v1_0.IExecutor; + +interface IFaceAuthExecutor extends IExecutor { +} \ No newline at end of file diff --git a/faceauth/v1_0/BUILD.gn b/faceauth/v1_0/BUILD.gn index af26adae..536225cf 100644 --- a/faceauth/v1_0/BUILD.gn +++ b/faceauth/v1_0/BUILD.gn @@ -1,32 +1,11 @@ -# Copyright (c) 2022 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/adapter/uhdf2/hdi.gni") -if (defined(ohos_lite)) { - group("libfaceauth_proxy_1.0") { - deps = [] - public_configs = [] - } -} else { - hdi("faceauth") { - module_name = "faceauth_interface_service" - - sources = [ - "IExecutor.idl", - "IFaceAuthInterface.idl", - ] - language = "cpp" - subsystem_name = "hdf" - part_name = "faceauth_device_driver" - } -} +import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 +hdi("faceauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so + module_name = "faceauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName + sources = [ # 参与编译的idl文件 + "IFaceAuthExecutor.idl", # 接口idl + "IFaceAuthInterface.idl" + ] + language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` + subsystem_name = "hdf" # 子系统,统一填写“hdf” + part_name = "hdf_device_driver" # 部件名,如果不属于已有部件,则需要定义新的部件 +} \ No newline at end of file diff --git a/faceauth/v1_0/IFaceAuthExecutor.idl b/faceauth/v1_0/IFaceAuthExecutor.idl new file mode 100644 index 00000000..060e2224 --- /dev/null +++ b/faceauth/v1_0/IFaceAuthExecutor.idl @@ -0,0 +1,10 @@ +import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 +hdi("faceauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so + module_name = "faceauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName + sources = [ # 参与编译的idl文件 + "IFaceAuthExecutor.idl", # 接口idl + ] + language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` + subsystem_name = "hdf" # 子系统,统一填写“hdf” + part_name = "hdf_device_driver" # 部件名,如果不属于已有部件,则需要定义新的部件 +} \ No newline at end of file diff --git a/faceauth/v1_0/IFaceAuthInterface.idl b/faceauth/v1_0/IFaceAuthInterface.idl index 2a1bdc9c..38a89671 100644 --- a/faceauth/v1_0/IFaceAuthInterface.idl +++ b/faceauth/v1_0/IFaceAuthInterface.idl @@ -15,8 +15,8 @@ package ohos.hdi.faceauth.v1_0; -import ohos.hdi.faceauth.v1_0.IExecutor; +import ohos.hdi.userauth.v1_0.IUserAuthInterface; -interface IFaceAuthInterface { - GetExecutorList([out] IExecutor [] executorList); -} +interface IFaceAuthInterface extends IIUserAuthInterface { + setBufferProducer(int bufferProducer); +} \ No newline at end of file diff --git a/userauth/v1_0/BUILD.gn b/userauth/v1_0/BUILD.gn new file mode 100644 index 00000000..e12baa56 --- /dev/null +++ b/userauth/v1_0/BUILD.gn @@ -0,0 +1,13 @@ +import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 +hdi("userauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so + module_name = "userauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName + sources = [ # 参与编译的idl文件 + "IExecutor.idl", # 接口idl + "IExecutorCallback.idl", # 用于回调的idl + "Types.idl", # 自定义类型idl + "IUserAuthInterface.idl", # 自定义类型idl + ] + language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` + subsystem_name = "hdf" # 子系统,统一填写“hdf” + part_name = "hdf_device_driver" # 部件名,如果不属于已有部件,则需要定义新的部件 +} \ No newline at end of file diff --git a/userauth/IExecutor.idl b/userauth/v1_0/IExecutor.idl similarity index 53% rename from userauth/IExecutor.idl rename to userauth/v1_0/IExecutor.idl index c6bb4a6b..172ab63f 100644 --- a/userauth/IExecutor.idl +++ b/userauth/v1_0/IExecutor.idl @@ -18,14 +18,14 @@ package ohos.hdi.userauth.v1_0; import ohos.hdi.userauth.v1_0.Types; import ohos.hdi.userauth.v1_0.IExecutorCallback; -full interface IExecutor { - GetExecutorInfo([out] ExecutorInfo info); - GetTemplateInfo([in] unsigned long templateId, [out] TemplateInfo info); - onRegisterFinish([in] unsigned long templateIdList, [in] byte[] frameworkPublicKey, [in] byte[] extraInfo); - Enroll([in] int scheduleId, [in] byte[] extraInfo, [in] IExecutorCallback callback) - Authenticate([in] int scheduleId, [in] unsigned long templateIdList, [in] byte[] extraInfo, [in] IExecutorCallback callback); - Identify([in] int scheduleId, [in] byte[] extraInfo, [in] IExecutorCallback callback); - Delete([in] unsigned long[] templateIdList); +interface IExecutor { + GetExecutorInfo([out] struct ExecutorInfo info); + GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo info); + OnRegisterFinish([in] unsigned long templateIdList, [in] byte [] frameworkPublicKey, [in] byte [] extraInfo); + Enroll([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Authenticate([in] int scheduleId, [in] unsigned long templateIdList, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Identify([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Delete([in] unsigned long [] templateIdList); Cancel([in] int scheduleId); - SendCommand([in] CommandId CommandId, [in] byte[] extraInfo, [in] IExecutorCallback callback); + SendCommand([in] enum CommandId commandId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); } \ No newline at end of file diff --git a/userauth/IExecutorCallback.idl b/userauth/v1_0/IExecutorCallback.idl similarity index 91% rename from userauth/IExecutorCallback.idl rename to userauth/v1_0/IExecutorCallback.idl index 030519b3..8cafcd4f 100644 --- a/userauth/IExecutorCallback.idl +++ b/userauth/v1_0/IExecutorCallback.idl @@ -15,7 +15,7 @@ package ohos.hdi.userauth.v1_0; -[callback] full interface IExecutorCallback { +[callback] interface IExecutorCallback { onResult([in] int code, [in] byte[] extraInfo); onAcquireInfo([in] int code, [in] byte[] extraInfo); } \ No newline at end of file diff --git a/userauth/v1_0/IUserAuthInterface.idl b/userauth/v1_0/IUserAuthInterface.idl new file mode 100644 index 00000000..67d1da15 --- /dev/null +++ b/userauth/v1_0/IUserAuthInterface.idl @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +import ohos.hdi.userauth.v1_0.IExecutor; + +interface IUserAuthInterface { + GetExecutorList([out] IExecutor [] executorList); +} \ No newline at end of file diff --git a/userauth/Types.idl b/userauth/v1_0/Types.idl similarity index 87% rename from userauth/Types.idl rename to userauth/v1_0/Types.idl index f41f4ddb..a9714a44 100644 --- a/userauth/Types.idl +++ b/userauth/v1_0/Types.idl @@ -18,40 +18,40 @@ package ohos.hdi.userauth.v1_0; enum AuthType : unsigned int { FACE, FINGERPRINT -} +}; enum ExecutorRole : unsigned int { COLLECTOR, VERIFIER, ALL_IN_ONE -} +}; enum ExecutorSecureLevel : unsigned int { ESL0, ESL1, ESL2, ESL3 -} +}; enum CommandId : unsigned int { LOCK_TEMPLATE = 0, UNLOCK_TEMPLATE, VENDOR_COMMAND_BEGIN = 10000 -} +}; struct ExecutorInfo { unsigned int sensorId; unsigned int executorType; - ExecutorRole executorRole; - AuthType authType; - ExecutorSecureLevel esl; + enum ExecutorRole executorRole; + enum AuthType authType; + enum ExecutorSecureLevel esl; byte[] publicKey; byte[] extraInfo; -} +}; struct TemplateInfo { unsigned int executorType; int freezingTime; int remainTimes; byte[] extraInfo; -} \ No newline at end of file +}; \ No newline at end of file -- Gitee From 53cc653a1d9654427779b5534662bcce32e69bc3 Mon Sep 17 00:00:00 2001 From: tianshi25 Date: Sat, 16 Apr 2022 20:46:24 +0800 Subject: [PATCH 4/6] update idl Change-Id: Id1e72a368ff0050e70fb96459902d586aa09c508 --- faceauth/v1_0/BUILD.gn | 6 ++- faceauth/v1_0/IExecutor.idl | 31 +++++++++++++++ faceauth/v1_0/IExecutorCallback.idl | 21 ++++++++++ faceauth/v1_0/IFaceAuthExecutor.idl | 10 ----- faceauth/v1_0/IFaceAuthInterface.idl | 6 +-- faceauth/v1_0/Types.idl | 57 ++++++++++++++++++++++++++++ userauth/v1_0/BUILD.gn | 8 ++-- 7 files changed, 120 insertions(+), 19 deletions(-) create mode 100644 faceauth/v1_0/IExecutor.idl create mode 100755 faceauth/v1_0/IExecutorCallback.idl delete mode 100644 faceauth/v1_0/IFaceAuthExecutor.idl create mode 100755 faceauth/v1_0/Types.idl diff --git a/faceauth/v1_0/BUILD.gn b/faceauth/v1_0/BUILD.gn index 536225cf..5abf712b 100644 --- a/faceauth/v1_0/BUILD.gn +++ b/faceauth/v1_0/BUILD.gn @@ -2,8 +2,10 @@ import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 hdi("faceauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so module_name = "faceauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName sources = [ # 参与编译的idl文件 - "IFaceAuthExecutor.idl", # 接口idl - "IFaceAuthInterface.idl" + "IExecutor.idl", + "IExecutorCallback.idl", + "Types.idl", + "IFaceAuthInterface.idl", ] language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` subsystem_name = "hdf" # 子系统,统一填写“hdf” diff --git a/faceauth/v1_0/IExecutor.idl b/faceauth/v1_0/IExecutor.idl new file mode 100644 index 00000000..384fdd5d --- /dev/null +++ b/faceauth/v1_0/IExecutor.idl @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +import ohos.hdi.faceauth.v1_0.Types; +import ohos.hdi.faceauth.v1_0.IExecutorCallback; + +interface IExecutor { + GetExecutorInfo([out] struct ExecutorInfo info); + GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo info); + OnRegisterFinish([in] unsigned long templateIdList, [in] byte [] frameworkPublicKey, [in] byte [] extraInfo); + Enroll([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Authenticate([in] int scheduleId, [in] unsigned long templateIdList, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Identify([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Delete([in] unsigned long [] templateIdList); + Cancel([in] int scheduleId); + SendCommand([in] enum CommandId commandId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); +} \ No newline at end of file diff --git a/faceauth/v1_0/IExecutorCallback.idl b/faceauth/v1_0/IExecutorCallback.idl new file mode 100755 index 00000000..ee004862 --- /dev/null +++ b/faceauth/v1_0/IExecutorCallback.idl @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +[callback] interface IExecutorCallback { + onResult([in] int code, [in] byte[] extraInfo); + onAcquireInfo([in] int code, [in] byte[] extraInfo); +} \ No newline at end of file diff --git a/faceauth/v1_0/IFaceAuthExecutor.idl b/faceauth/v1_0/IFaceAuthExecutor.idl deleted file mode 100644 index 060e2224..00000000 --- a/faceauth/v1_0/IFaceAuthExecutor.idl +++ /dev/null @@ -1,10 +0,0 @@ -import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 -hdi("faceauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so - module_name = "faceauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName - sources = [ # 参与编译的idl文件 - "IFaceAuthExecutor.idl", # 接口idl - ] - language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` - subsystem_name = "hdf" # 子系统,统一填写“hdf” - part_name = "hdf_device_driver" # 部件名,如果不属于已有部件,则需要定义新的部件 -} \ No newline at end of file diff --git a/faceauth/v1_0/IFaceAuthInterface.idl b/faceauth/v1_0/IFaceAuthInterface.idl index 38a89671..070f44dd 100644 --- a/faceauth/v1_0/IFaceAuthInterface.idl +++ b/faceauth/v1_0/IFaceAuthInterface.idl @@ -15,8 +15,8 @@ package ohos.hdi.faceauth.v1_0; -import ohos.hdi.userauth.v1_0.IUserAuthInterface; +import ohos.hdi.faceauth.v1_0.IExecutor; -interface IFaceAuthInterface extends IIUserAuthInterface { - setBufferProducer(int bufferProducer); +interface IFaceAuthInterface { + GetExecutorList([out] IExecutor [] executorList); } \ No newline at end of file diff --git a/faceauth/v1_0/Types.idl b/faceauth/v1_0/Types.idl new file mode 100755 index 00000000..97786a54 --- /dev/null +++ b/faceauth/v1_0/Types.idl @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +enum AuthType : unsigned int { + FACE, + FINGERPRINT +}; + +enum ExecutorRole : unsigned int { + COLLECTOR, + VERIFIER, + ALL_IN_ONE +}; + +enum ExecutorSecureLevel : unsigned int { + ESL0, + ESL1, + ESL2, + ESL3 +}; + +enum CommandId : unsigned int { + LOCK_TEMPLATE = 0, + UNLOCK_TEMPLATE, + VENDOR_COMMAND_BEGIN = 10000 +}; + +struct ExecutorInfo { + unsigned int sensorId; + unsigned int executorType; + enum ExecutorRole executorRole; + enum AuthType authType; + enum ExecutorSecureLevel esl; + byte[] publicKey; + byte[] extraInfo; +}; + +struct TemplateInfo { + unsigned int executorType; + int freezingTime; + int remainTimes; + byte[] extraInfo; +}; \ No newline at end of file diff --git a/userauth/v1_0/BUILD.gn b/userauth/v1_0/BUILD.gn index e12baa56..96797d6d 100644 --- a/userauth/v1_0/BUILD.gn +++ b/userauth/v1_0/BUILD.gn @@ -2,10 +2,10 @@ import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 hdi("userauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so module_name = "userauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName sources = [ # 参与编译的idl文件 - "IExecutor.idl", # 接口idl - "IExecutorCallback.idl", # 用于回调的idl - "Types.idl", # 自定义类型idl - "IUserAuthInterface.idl", # 自定义类型idl + "IExecutor.idl", + "IExecutorCallback.idl", + "Types.idl", + "IUserAuthInterface.idl", ] language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` subsystem_name = "hdf" # 子系统,统一填写“hdf” -- Gitee From e0581559d15cc957748c5e1bcf117e717df93539 Mon Sep 17 00:00:00 2001 From: tianshi25 Date: Sun, 17 Apr 2022 17:31:53 +0800 Subject: [PATCH 5/6] update idl Change-Id: Ib2662d4542a14d495859ddbbd7b5c3e92ec548e5 --- faceauth/V1_0/IFaceAuthExecutor.idl | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 faceauth/V1_0/IFaceAuthExecutor.idl diff --git a/faceauth/V1_0/IFaceAuthExecutor.idl b/faceauth/V1_0/IFaceAuthExecutor.idl deleted file mode 100644 index fcd136f7..00000000 --- a/faceauth/V1_0/IFaceAuthExecutor.idl +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -package ohos.hdi.faceauth.v1_0; - -import ohos.hdi.userauth.v1_0.IExecutor; - -interface IFaceAuthExecutor extends IExecutor { -} \ No newline at end of file -- Gitee From a1cf9fd19cb28157f8ef86db11961e9163ec6c38 Mon Sep 17 00:00:00 2001 From: tianshi25 Date: Mon, 18 Apr 2022 13:34:51 +0800 Subject: [PATCH 6/6] update idl Change-Id: Ieb0b59a429ff678e0ec515fef1476ff343977298 --- faceauth/v1_0/IExecutor.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faceauth/v1_0/IExecutor.idl b/faceauth/v1_0/IExecutor.idl index 384fdd5d..3c287beb 100644 --- a/faceauth/v1_0/IExecutor.idl +++ b/faceauth/v1_0/IExecutor.idl @@ -23,7 +23,7 @@ interface IExecutor { GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo info); OnRegisterFinish([in] unsigned long templateIdList, [in] byte [] frameworkPublicKey, [in] byte [] extraInfo); Enroll([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); - Authenticate([in] int scheduleId, [in] unsigned long templateIdList, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Authenticate([in] int scheduleId, [in] unsigned long [] templateIdList, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); Identify([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); Delete([in] unsigned long [] templateIdList); Cancel([in] int scheduleId); -- Gitee