diff --git a/framework/tools/hdi-gen/BUILD.gn b/framework/tools/hdi-gen/BUILD.gn old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/Makefile b/framework/tools/hdi-gen/Makefile old mode 100644 new mode 100755 index 437bd00b5ec509a4147ec17dd2f8748c468fdbf7..7233a0d7e960242ca0fd6edd16620318982d4cf1 --- a/framework/tools/hdi-gen/Makefile +++ b/framework/tools/hdi-gen/Makefile @@ -16,7 +16,7 @@ else export TARGET:=$(TARGET_DIR)/hdi-gen endif -export CXXFLAGS = -std=c++14 -O2 -Wall -fno-common -fno-strict-aliasing -s +export CXXFLAGS = -std=c++14 -O2 -Wall -fno-common -fno-strict-aliasing -s -g export Q := @ export MAKEFLAGS += --no-print-directory diff --git a/framework/tools/hdi-gen/MakefileLinux b/framework/tools/hdi-gen/MakefileLinux old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/MakefileWin b/framework/tools/hdi-gen/MakefileWin old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast.cpp b/framework/tools/hdi-gen/ast/ast.cpp old mode 100644 new mode 100755 index 2c70f3f2d2a066ddb949dde1b03847b545188559..02e9752580e6e54e3ff46b778b3679fea01fb118 --- a/framework/tools/hdi-gen/ast/ast.cpp +++ b/framework/tools/hdi-gen/ast/ast.cpp @@ -10,6 +10,7 @@ #include +#include "util/logger.h" #include "util/string_builder.h" namespace OHOS { @@ -65,11 +66,7 @@ void AST::SetFullName(const std::string &fullName) void AST::SetPackageName(const std::string &packageName) { packageName_ = packageName; -} - -std::string AST::GetPackageName() -{ - return packageName_; + ParseNamespace(packageName_); } AutoPtr AST::ParseNamespace(const std::string &nspaceStr) @@ -155,15 +152,16 @@ void AST::AddType(const AutoPtr &type) types_[type->ToString()] = type; } -AutoPtr AST::FindType(const std::string &typeName) +AutoPtr AST::FindType(const std::string &typeName, bool lookImports) { if (typeName.empty()) { return nullptr; } - auto it = types_.find(typeName); - if (it != types_.end()) { - return it->second; + for (const auto &type : types_) { + if (type.second->GetName() == typeName) { + return type.second; + } } auto basicTypePair = basicTypes_.find(typeName); @@ -171,13 +169,18 @@ AutoPtr AST::FindType(const std::string &typeName) return basicTypePair->second; } + if (!lookImports) { + return nullptr; + } + AutoPtr type = nullptr; for (const auto &importPair : imports_) { - type = importPair.second->FindType(typeName); + type = importPair.second->FindType(typeName, false); if (type != nullptr) { break; } } + return type; } @@ -187,6 +190,10 @@ void AST::AddTypeDefinition(const AutoPtr &type) return; } + if (namespaces_.size() > 0) { + type->SetNamespace(namespaces_[0]); + } + AddType(type); typeDefinitions_.push_back(type); } diff --git a/framework/tools/hdi-gen/ast/ast.h b/framework/tools/hdi-gen/ast/ast.h old mode 100644 new mode 100755 index 6c8ed9bacf292cb214f9fa99fb23be8cd4c8de7c..7abbc794b936f932f773704018ae3c97627ce3a9 --- a/framework/tools/hdi-gen/ast/ast.h +++ b/framework/tools/hdi-gen/ast/ast.h @@ -97,8 +97,6 @@ public: void SetPackageName(const std::string &packageName); - std::string GetPackageName(); - AutoPtr ParseNamespace(const std::string &nspaceStr); void AddNamespace(const AutoPtr &nspace); @@ -133,7 +131,7 @@ public: void AddType(const AutoPtr &type); - AutoPtr FindType(const std::string &typeName); + AutoPtr FindType(const std::string &typeName, bool lookImports = true); inline const TypeStringMap &GetTypes() const { @@ -198,6 +196,8 @@ private: size_t majorVersion_; size_t minorVersion_; std::vector> namespaces_; + std::vector> allNamespaces_; + AutoPtr namespace_; std::vector> typeDefinitions_; AutoPtr sequenceableDef_ = nullptr; AutoPtr interfaceDef_ = nullptr; diff --git a/framework/tools/hdi-gen/ast/ast_array_type.cpp b/framework/tools/hdi-gen/ast/ast_array_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_array_type.h b/framework/tools/hdi-gen/ast/ast_array_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_attribute.cpp b/framework/tools/hdi-gen/ast/ast_attribute.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_attribute.h b/framework/tools/hdi-gen/ast/ast_attribute.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_boolean_type.cpp b/framework/tools/hdi-gen/ast/ast_boolean_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_boolean_type.h b/framework/tools/hdi-gen/ast/ast_boolean_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_byte_type.cpp b/framework/tools/hdi-gen/ast/ast_byte_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_byte_type.h b/framework/tools/hdi-gen/ast/ast_byte_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_double_type.cpp b/framework/tools/hdi-gen/ast/ast_double_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_double_type.h b/framework/tools/hdi-gen/ast/ast_double_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_enum_type.cpp b/framework/tools/hdi-gen/ast/ast_enum_type.cpp old mode 100644 new mode 100755 index 7f9066d1899cd83ff2223635128de6027be0d98c..f0781a126d77e2e6c3469ed73d1bf62e7fca13d1 --- a/framework/tools/hdi-gen/ast/ast_enum_type.cpp +++ b/framework/tools/hdi-gen/ast/ast_enum_type.cpp @@ -29,10 +29,10 @@ bool ASTEnumType::IsEnumType() return true; } -std::string ASTEnumType::ToString() const -{ - return "enum " + name_; -} +// std::string ASTEnumType::ToString() const +// { +// return "enum " + name_; +// } std::string ASTEnumType::Dump(const std::string &prefix) { diff --git a/framework/tools/hdi-gen/ast/ast_enum_type.h b/framework/tools/hdi-gen/ast/ast_enum_type.h old mode 100644 new mode 100755 index c2e3ca1e1c7c886dcbf5e974c35e72af6cc286a4..4def3d8a53f80a93801980c8431050cb589cf8d1 --- a/framework/tools/hdi-gen/ast/ast_enum_type.h +++ b/framework/tools/hdi-gen/ast/ast_enum_type.h @@ -110,7 +110,7 @@ public: bool IsEnumType() override; - std::string ToString() const override; + // std::string ToString() const override; std::string Dump(const std::string &prefix) override; diff --git a/framework/tools/hdi-gen/ast/ast_expr.cpp b/framework/tools/hdi-gen/ast/ast_expr.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_expr.h b/framework/tools/hdi-gen/ast/ast_expr.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_fd_type.cpp b/framework/tools/hdi-gen/ast/ast_fd_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_fd_type.h b/framework/tools/hdi-gen/ast/ast_fd_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_float_type.cpp b/framework/tools/hdi-gen/ast/ast_float_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_float_type.h b/framework/tools/hdi-gen/ast/ast_float_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_integer_type.cpp b/framework/tools/hdi-gen/ast/ast_integer_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_integer_type.h b/framework/tools/hdi-gen/ast/ast_integer_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_interface_type.cpp b/framework/tools/hdi-gen/ast/ast_interface_type.cpp old mode 100644 new mode 100755 index 733002d39e209b1b2dee4e911632254313c62d35..6c82849a9a61fd5ca384a029538f3766ae59e9a5 --- a/framework/tools/hdi-gen/ast/ast_interface_type.cpp +++ b/framework/tools/hdi-gen/ast/ast_interface_type.cpp @@ -67,10 +67,10 @@ bool ASTInterfaceType::IsInterfaceType() return true; } -std::string ASTInterfaceType::ToString() const -{ - return name_; -} +// std::string ASTInterfaceType::ToString() const +// { +// return name_; +// } std::string ASTInterfaceType::Dump(const std::string &prefix) { diff --git a/framework/tools/hdi-gen/ast/ast_interface_type.h b/framework/tools/hdi-gen/ast/ast_interface_type.h old mode 100644 new mode 100755 index 2fddf4edbc8a47eaf94ca89f9d1cdb590519e4b9..af2e13ebeedcb39268a2024dfb3d68520fac8c0e --- a/framework/tools/hdi-gen/ast/ast_interface_type.h +++ b/framework/tools/hdi-gen/ast/ast_interface_type.h @@ -138,7 +138,7 @@ public: bool IsInterfaceType() override; - std::string ToString() const override; + // std::string ToString() const override; std::string Dump(const std::string &prefix) override; diff --git a/framework/tools/hdi-gen/ast/ast_long_type.cpp b/framework/tools/hdi-gen/ast/ast_long_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_long_type.h b/framework/tools/hdi-gen/ast/ast_long_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_map_type.cpp b/framework/tools/hdi-gen/ast/ast_map_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_map_type.h b/framework/tools/hdi-gen/ast/ast_map_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_method.cpp b/framework/tools/hdi-gen/ast/ast_method.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_method.h b/framework/tools/hdi-gen/ast/ast_method.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_namespace.cpp b/framework/tools/hdi-gen/ast/ast_namespace.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_namespace.h b/framework/tools/hdi-gen/ast/ast_namespace.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_native_buffer_type.cpp b/framework/tools/hdi-gen/ast/ast_native_buffer_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_native_buffer_type.h b/framework/tools/hdi-gen/ast/ast_native_buffer_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_node.cpp b/framework/tools/hdi-gen/ast/ast_node.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_node.h b/framework/tools/hdi-gen/ast/ast_node.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_parameter.cpp b/framework/tools/hdi-gen/ast/ast_parameter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_parameter.h b/framework/tools/hdi-gen/ast/ast_parameter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_sequenceable_type.cpp b/framework/tools/hdi-gen/ast/ast_sequenceable_type.cpp old mode 100644 new mode 100755 index 47ffd6285b814ba4d8db7d336fec27225881ef62..9534ca2c42dfb57727c5bf977ae9a68b703f53bc --- a/framework/tools/hdi-gen/ast/ast_sequenceable_type.cpp +++ b/framework/tools/hdi-gen/ast/ast_sequenceable_type.cpp @@ -24,10 +24,10 @@ bool ASTSequenceableType::IsSequenceableType() return true; } -std::string ASTSequenceableType::ToString() const -{ - return name_; -} +// std::string ASTSequenceableType::ToString() const +// { +// return name_; +// } TypeKind ASTSequenceableType::GetTypeKind() { diff --git a/framework/tools/hdi-gen/ast/ast_sequenceable_type.h b/framework/tools/hdi-gen/ast/ast_sequenceable_type.h old mode 100644 new mode 100755 index 2d54d393efa0f6ab04dad7b3e3b6e0f39379f81c..497321cf58d6c3a163999332bcfaff93df44ae62 --- a/framework/tools/hdi-gen/ast/ast_sequenceable_type.h +++ b/framework/tools/hdi-gen/ast/ast_sequenceable_type.h @@ -21,7 +21,7 @@ public: bool IsSequenceableType() override; - std::string ToString() const override; + // std::string ToString() const override; std::string Dump(const std::string &prefix) override; diff --git a/framework/tools/hdi-gen/ast/ast_short_type.cpp b/framework/tools/hdi-gen/ast/ast_short_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_short_type.h b/framework/tools/hdi-gen/ast/ast_short_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_smq_type.cpp b/framework/tools/hdi-gen/ast/ast_smq_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_smq_type.h b/framework/tools/hdi-gen/ast/ast_smq_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_string_type.cpp b/framework/tools/hdi-gen/ast/ast_string_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_string_type.h b/framework/tools/hdi-gen/ast/ast_string_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_struct_type.cpp b/framework/tools/hdi-gen/ast/ast_struct_type.cpp old mode 100644 new mode 100755 index f48e87a0dc6dff8ec4b2e86d74bd6103deaeec94..79b5eed282b167ed8723d92d06b651ebbf3c2ef6 --- a/framework/tools/hdi-gen/ast/ast_struct_type.cpp +++ b/framework/tools/hdi-gen/ast/ast_struct_type.cpp @@ -30,10 +30,10 @@ bool ASTStructType::IsStructType() return true; } -std::string ASTStructType::ToString() const -{ - return "struct " + name_; -} +// std::string ASTStructType::ToString() const +// { +// return "struct " + name_; +// } std::string ASTStructType::Dump(const std::string &prefix) { diff --git a/framework/tools/hdi-gen/ast/ast_struct_type.h b/framework/tools/hdi-gen/ast/ast_struct_type.h old mode 100644 new mode 100755 index ec5198679b56aaf8af13f6530e4709e04b413ac9..f3eda3455d410f9bf2ae4081c17d356dfa45d8fd --- a/framework/tools/hdi-gen/ast/ast_struct_type.h +++ b/framework/tools/hdi-gen/ast/ast_struct_type.h @@ -74,7 +74,7 @@ public: bool IsStructType() override; - std::string ToString() const override; + // std::string ToString() const override; std::string Dump(const std::string &prefix) override; diff --git a/framework/tools/hdi-gen/ast/ast_type.cpp b/framework/tools/hdi-gen/ast/ast_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_type.h b/framework/tools/hdi-gen/ast/ast_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_uchar_type.cpp b/framework/tools/hdi-gen/ast/ast_uchar_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_uchar_type.h b/framework/tools/hdi-gen/ast/ast_uchar_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_uint_type.cpp b/framework/tools/hdi-gen/ast/ast_uint_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_uint_type.h b/framework/tools/hdi-gen/ast/ast_uint_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_ulong_type.cpp b/framework/tools/hdi-gen/ast/ast_ulong_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_ulong_type.h b/framework/tools/hdi-gen/ast/ast_ulong_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_union_type.cpp b/framework/tools/hdi-gen/ast/ast_union_type.cpp old mode 100644 new mode 100755 index 03024fee5c8d8b107cd26206e8c4529e8461ed83..b6c8b0cb0138e8a03208e27a6a0c6836db7c879b --- a/framework/tools/hdi-gen/ast/ast_union_type.cpp +++ b/framework/tools/hdi-gen/ast/ast_union_type.cpp @@ -27,10 +27,10 @@ bool ASTUnionType::IsUnionType() return true; } -std::string ASTUnionType::ToString() const -{ - return "union " + name_; -} +// std::string ASTUnionType::ToString() const +// { +// return "union " + name_; +// } std::string ASTUnionType::Dump(const std::string &prefix) { diff --git a/framework/tools/hdi-gen/ast/ast_union_type.h b/framework/tools/hdi-gen/ast/ast_union_type.h old mode 100644 new mode 100755 index 4bd142305676000d624b98cf63fe417fb51d721b..c1696abd0171bc4fa2c5a6777d703ffbde2d5705 --- a/framework/tools/hdi-gen/ast/ast_union_type.h +++ b/framework/tools/hdi-gen/ast/ast_union_type.h @@ -74,7 +74,7 @@ public: bool IsUnionType() override; - std::string ToString() const override; + // std::string ToString() const override; std::string Dump(const std::string &prefix) override; diff --git a/framework/tools/hdi-gen/ast/ast_ushort_type.cpp b/framework/tools/hdi-gen/ast/ast_ushort_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_ushort_type.h b/framework/tools/hdi-gen/ast/ast_ushort_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_void_type.cpp b/framework/tools/hdi-gen/ast/ast_void_type.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/ast/ast_void_type.h b/framework/tools/hdi-gen/ast/ast_void_type.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/build/ast/ast.o b/framework/tools/hdi-gen/build/ast/ast.o new file mode 100755 index 0000000000000000000000000000000000000000..9e2900800c3aa56935679d1941aa71dac7609af4 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_array_type.o b/framework/tools/hdi-gen/build/ast/ast_array_type.o new file mode 100755 index 0000000000000000000000000000000000000000..d508abf3d3e85ecc60686a84d27cff3dab6a3965 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_array_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_attribute.o b/framework/tools/hdi-gen/build/ast/ast_attribute.o new file mode 100755 index 0000000000000000000000000000000000000000..e14fb885ae7d7804a102dd08cb0e3a467497b0be Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_attribute.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_boolean_type.o b/framework/tools/hdi-gen/build/ast/ast_boolean_type.o new file mode 100755 index 0000000000000000000000000000000000000000..6a8727e15485c8356f0f05830d7dd973b0126e28 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_boolean_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_byte_type.o b/framework/tools/hdi-gen/build/ast/ast_byte_type.o new file mode 100755 index 0000000000000000000000000000000000000000..3736186586900b3a83e699c48591dc891ef4b458 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_byte_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_double_type.o b/framework/tools/hdi-gen/build/ast/ast_double_type.o new file mode 100755 index 0000000000000000000000000000000000000000..49c9e644ba09ff8e52b6c92b762444864e173d8f Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_double_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_enum_type.o b/framework/tools/hdi-gen/build/ast/ast_enum_type.o new file mode 100755 index 0000000000000000000000000000000000000000..d5682f88111145d35c9b599ee4896ba7ff54a2ee Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_enum_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_expr.o b/framework/tools/hdi-gen/build/ast/ast_expr.o new file mode 100755 index 0000000000000000000000000000000000000000..3b784787d2cf2ca5edadc26f345314329551220a Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_expr.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_fd_type.o b/framework/tools/hdi-gen/build/ast/ast_fd_type.o new file mode 100755 index 0000000000000000000000000000000000000000..250413df1822b99f8fb5aa1a291d9eefda586a8b Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_fd_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_float_type.o b/framework/tools/hdi-gen/build/ast/ast_float_type.o new file mode 100755 index 0000000000000000000000000000000000000000..88584b6de4535133651af4b5b3e10f91bd9a9a1c Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_float_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_integer_type.o b/framework/tools/hdi-gen/build/ast/ast_integer_type.o new file mode 100755 index 0000000000000000000000000000000000000000..a7b4a09a974a771a19f99f1d64fcfb3948ee4a79 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_integer_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_interface_type.o b/framework/tools/hdi-gen/build/ast/ast_interface_type.o new file mode 100755 index 0000000000000000000000000000000000000000..629c457bd72721c2dacd181224ca52de28aeaeff Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_interface_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_long_type.o b/framework/tools/hdi-gen/build/ast/ast_long_type.o new file mode 100755 index 0000000000000000000000000000000000000000..bea1de8a2c9cf1f70b64201fd3408de8b95f551a Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_long_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_map_type.o b/framework/tools/hdi-gen/build/ast/ast_map_type.o new file mode 100755 index 0000000000000000000000000000000000000000..42000f4a45a762913975827eb5c3e4cb5366ff59 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_map_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_method.o b/framework/tools/hdi-gen/build/ast/ast_method.o new file mode 100755 index 0000000000000000000000000000000000000000..f168e747003f4aaaf86504dbef0748ed04bc3b0c Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_method.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_namespace.o b/framework/tools/hdi-gen/build/ast/ast_namespace.o new file mode 100755 index 0000000000000000000000000000000000000000..79f76235e2ac1469de953ddb627e98287054c42a Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_namespace.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_native_buffer_type.o b/framework/tools/hdi-gen/build/ast/ast_native_buffer_type.o new file mode 100755 index 0000000000000000000000000000000000000000..f88848a7a7a81295054860aa87e31c12fe7790f7 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_native_buffer_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_node.o b/framework/tools/hdi-gen/build/ast/ast_node.o new file mode 100755 index 0000000000000000000000000000000000000000..e706e552ce3bb993245795a34eb40d7aa043992f Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_node.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_parameter.o b/framework/tools/hdi-gen/build/ast/ast_parameter.o new file mode 100755 index 0000000000000000000000000000000000000000..a08ef7c0c86171443fa2060c2e4a222cd7bfedd0 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_parameter.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_sequenceable_type.o b/framework/tools/hdi-gen/build/ast/ast_sequenceable_type.o new file mode 100755 index 0000000000000000000000000000000000000000..b2e2df9b591fc33484226ff64809ccc7502cc7d0 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_sequenceable_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_short_type.o b/framework/tools/hdi-gen/build/ast/ast_short_type.o new file mode 100755 index 0000000000000000000000000000000000000000..a3aa59a24bf0dfd6ef6315bfe196639ad81710e6 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_short_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_smq_type.o b/framework/tools/hdi-gen/build/ast/ast_smq_type.o new file mode 100755 index 0000000000000000000000000000000000000000..cd996f838bcf6863cdcf3dd2c4c5a9b3820500d3 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_smq_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_string_type.o b/framework/tools/hdi-gen/build/ast/ast_string_type.o new file mode 100755 index 0000000000000000000000000000000000000000..8ada594c34c8edb354379db022816543d9d5533a Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_string_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_struct_type.o b/framework/tools/hdi-gen/build/ast/ast_struct_type.o new file mode 100755 index 0000000000000000000000000000000000000000..8bd93bf6d535644cc3d82ed7b50caaeb3d12ccbb Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_struct_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_type.o b/framework/tools/hdi-gen/build/ast/ast_type.o new file mode 100755 index 0000000000000000000000000000000000000000..08d487cdf7b37504ddaa95a19eb87d0812599ba6 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_uchar_type.o b/framework/tools/hdi-gen/build/ast/ast_uchar_type.o new file mode 100755 index 0000000000000000000000000000000000000000..c01d5a03e8dfd772b4906b0cf111ab19429a8856 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_uchar_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_uint_type.o b/framework/tools/hdi-gen/build/ast/ast_uint_type.o new file mode 100755 index 0000000000000000000000000000000000000000..74bae146bbc12fb0e617afacacc5c32143f1e03e Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_uint_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_ulong_type.o b/framework/tools/hdi-gen/build/ast/ast_ulong_type.o new file mode 100755 index 0000000000000000000000000000000000000000..d544eca546356e6c51761cb81a9474f53dccecf5 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_ulong_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_union_type.o b/framework/tools/hdi-gen/build/ast/ast_union_type.o new file mode 100755 index 0000000000000000000000000000000000000000..e54acb21591319ff005809314333582efc76718a Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_union_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_ushort_type.o b/framework/tools/hdi-gen/build/ast/ast_ushort_type.o new file mode 100755 index 0000000000000000000000000000000000000000..3df575cd6c382fa67e76045dfd5350926b66cd65 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_ushort_type.o differ diff --git a/framework/tools/hdi-gen/build/ast/ast_void_type.o b/framework/tools/hdi-gen/build/ast/ast_void_type.o new file mode 100755 index 0000000000000000000000000000000000000000..f1b240a7df629c341a9aba8574404cd1bb40a8a4 Binary files /dev/null and b/framework/tools/hdi-gen/build/ast/ast_void_type.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/fscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/fscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..3b31451dbe3cdc1d2c583de8a4319e9691e2bb9f Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/fscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/fwscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/fwscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..051b3c08fd523830ad632ca16489d55bb5327b50 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/fwscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/gets_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/gets_s.o new file mode 100755 index 0000000000000000000000000000000000000000..9e3d451f7806f50500df07c53b39683f66bd74c0 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/gets_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/memcpy_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/memcpy_s.o new file mode 100755 index 0000000000000000000000000000000000000000..bb604a6db6a6b2b93e1fabaee9c0b49d65925c8c Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/memcpy_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/memmove_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/memmove_s.o new file mode 100755 index 0000000000000000000000000000000000000000..689604b3b8fe820299b7877a0a74708c25a01bb2 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/memmove_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/memset_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/memset_s.o new file mode 100755 index 0000000000000000000000000000000000000000..932fb11926b8be067a85a6077f0a3a5b8a66b8cb Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/memset_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/scanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/scanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..2a0b851d170537a2da4724085eea9ba0e7f88d36 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/scanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/securecutil.o b/framework/tools/hdi-gen/build/bounds_checking_function/securecutil.o new file mode 100755 index 0000000000000000000000000000000000000000..4b6f122f5a2bf240acaff47e4dac61c004b54dfa Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/securecutil.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/secureinput_a.o b/framework/tools/hdi-gen/build/bounds_checking_function/secureinput_a.o new file mode 100755 index 0000000000000000000000000000000000000000..a1be2679260487fe9fc54421843fe2bcdaa29efd Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/secureinput_a.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/secureinput_w.o b/framework/tools/hdi-gen/build/bounds_checking_function/secureinput_w.o new file mode 100755 index 0000000000000000000000000000000000000000..3bb25db62d9aabd041e6fedc3732372f01f423e5 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/secureinput_w.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/secureprintoutput_a.o b/framework/tools/hdi-gen/build/bounds_checking_function/secureprintoutput_a.o new file mode 100755 index 0000000000000000000000000000000000000000..45a8d272c2b65f208a9a04776af1f1a4e2804562 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/secureprintoutput_a.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/secureprintoutput_w.o b/framework/tools/hdi-gen/build/bounds_checking_function/secureprintoutput_w.o new file mode 100755 index 0000000000000000000000000000000000000000..702b6d9140072b898657685c683e6c4fa931bc6f Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/secureprintoutput_w.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/snprintf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/snprintf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..25864a2c333c1acc2a0ce0fdadf612819f208195 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/snprintf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/sprintf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/sprintf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..241210c9acbb2fba5dc9503782724c28afdeb78a Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/sprintf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/sscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/sscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..661248578361fe2ae2bbe5d48fcf258325ff3bda Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/sscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/strcat_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/strcat_s.o new file mode 100755 index 0000000000000000000000000000000000000000..bae083cdc8b721b820844967cbc4de939b950197 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/strcat_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/strcpy_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/strcpy_s.o new file mode 100755 index 0000000000000000000000000000000000000000..1a5f01ca65c0c619eb291cefd3de5497e90f5d8f Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/strcpy_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/strncat_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/strncat_s.o new file mode 100755 index 0000000000000000000000000000000000000000..ed5efd474ccc247c444f01dcde92e508088cb490 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/strncat_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/strncpy_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/strncpy_s.o new file mode 100755 index 0000000000000000000000000000000000000000..a9e3193f66ad94519524510ad7a0b511d43ad5b4 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/strncpy_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/strtok_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/strtok_s.o new file mode 100755 index 0000000000000000000000000000000000000000..48fd18b7398aece7356bded6ace74f77b3d0a76e Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/strtok_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/swprintf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/swprintf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..f0d6602a121ee36452f1709d95fade1a40625bfb Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/swprintf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/swscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/swscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..cd79d043d30214cf939f3ebfee306d4586281b05 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/swscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vfscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vfscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..1bbcbe9fe4cd67c6cd47f59aa924fd6e0b93078e Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vfscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vfwscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vfwscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..f947006590d693d9aa07b17994e40a8490b94f5f Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vfwscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..05a49bc2a65a755d25752d6ff70fe19310c3eecd Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vsnprintf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vsnprintf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..904dab3d253549576485b2af5d064b1ad86948b1 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vsnprintf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vsprintf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vsprintf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..e059fb4c5c5537fd2311d8c31f46d7df9763dc54 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vsprintf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vsscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vsscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..18c495e2a7ada91474e327cdcd4b1d752c29922c Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vsscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vswprintf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vswprintf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..951f7d480c25e6e863966a102180352d3d331ed1 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vswprintf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vswscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vswscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..0d870a4bcd0c1c55436722bddeae6f2dd87bd97f Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vswscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/vwscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/vwscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..540773231f3bd0f203b242606ac205ed97bfe6db Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/vwscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wcscat_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wcscat_s.o new file mode 100755 index 0000000000000000000000000000000000000000..f92184f3792fe29e79a1982c8a3d5a450d71f901 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wcscat_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wcscpy_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wcscpy_s.o new file mode 100755 index 0000000000000000000000000000000000000000..164f3f9cc9ef8655a6bb7ffdc9c9272a98c3a5f3 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wcscpy_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wcsncat_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wcsncat_s.o new file mode 100755 index 0000000000000000000000000000000000000000..74d80fa8e676fb80b92997c6e32a845b3556cf2a Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wcsncat_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wcsncpy_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wcsncpy_s.o new file mode 100755 index 0000000000000000000000000000000000000000..5541823669cb46ea907d0d747595546d44e95d5c Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wcsncpy_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wcstok_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wcstok_s.o new file mode 100755 index 0000000000000000000000000000000000000000..52582539ebf531cfc217cfe7be46cac3d9dec93f Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wcstok_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wmemcpy_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wmemcpy_s.o new file mode 100755 index 0000000000000000000000000000000000000000..efbdbaf37e63196a9293163f71542c9779f64566 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wmemcpy_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wmemmove_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wmemmove_s.o new file mode 100755 index 0000000000000000000000000000000000000000..ad6be2ac926a419914a99e01f4bbe84f579b45a0 Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wmemmove_s.o differ diff --git a/framework/tools/hdi-gen/build/bounds_checking_function/wscanf_s.o b/framework/tools/hdi-gen/build/bounds_checking_function/wscanf_s.o new file mode 100755 index 0000000000000000000000000000000000000000..0b377165b467478f282a1c553114903265debacb Binary files /dev/null and b/framework/tools/hdi-gen/build/bounds_checking_function/wscanf_s.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_client_proxy_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_client_proxy_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..955065b61fbb573e08b2adb8b2a2fd74b7dff962 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_client_proxy_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..1a29773351ae4530dffb6e6aebf3ada646d15109 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_custom_types_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_custom_types_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..66837ef1d20730525edb3eee610aaaaa42a37d17 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_custom_types_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_interface_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_interface_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..d342a4857f98e445c6aa1570ab7afaa23c75b181 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_interface_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_service_driver_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_service_driver_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..90cbf9dfc4378995941be6aa8ee5cb12aa5bb666 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_service_driver_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_service_impl_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_service_impl_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..3760ff9465ee4974e32c5afced36102996e89c97 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_service_impl_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/c_service_stub_code_emitter.o b/framework/tools/hdi-gen/build/codegen/c_service_stub_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..ec93eaf9f5623146c0e74bb2155dc78bd85cd8c6 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/c_service_stub_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/code_emitter.o b/framework/tools/hdi-gen/build/codegen/code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..583d907d2f0337ce4133dc81e3a106f622e3f944 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/code_generator.o b/framework/tools/hdi-gen/build/codegen/code_generator.o new file mode 100755 index 0000000000000000000000000000000000000000..93b1cc4115d6e552fa1129a417393ea906d4a08f Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/code_generator.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_client_proxy_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_client_proxy_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..b2650fc804098ed56569ae35dc3000180b5550d1 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_client_proxy_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..243f6a0afdf451484a58ef652395ddb0241cd891 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_custom_types_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_custom_types_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..ca377cdacdadb7dc206b11219f41797dca8c2e35 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_custom_types_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_interface_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_interface_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..8ecf3299280aebca11c7129c3f8970f806143e22 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_interface_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_service_driver_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_service_driver_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..b44f9f17c015319d63e5ef91ad6263510e6ad5ef Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_service_driver_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_service_impl_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_service_impl_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..39f76db76a600bd552fb720ca7e10e1d4d84e8c7 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_service_impl_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/cpp_service_stub_code_emitter.o b/framework/tools/hdi-gen/build/codegen/cpp_service_stub_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..0ff049f0c051b655239f6973cc13d83441c53144 Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/cpp_service_stub_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/java_client_interface_code_emitter.o b/framework/tools/hdi-gen/build/codegen/java_client_interface_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..4c9f641c765a2f0ea9240d30aab7dc51c69b830c Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/java_client_interface_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/java_client_proxy_code_emitter.o b/framework/tools/hdi-gen/build/codegen/java_client_proxy_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..d739916c829a003a2ced8be3ca5c163258b5db3d Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/java_client_proxy_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/codegen/java_code_emitter.o b/framework/tools/hdi-gen/build/codegen/java_code_emitter.o new file mode 100755 index 0000000000000000000000000000000000000000..59f08221acff177a2ec25c21b15451b3c91c1f6b Binary files /dev/null and b/framework/tools/hdi-gen/build/codegen/java_code_emitter.o differ diff --git a/framework/tools/hdi-gen/build/hash/hash.o b/framework/tools/hdi-gen/build/hash/hash.o new file mode 100755 index 0000000000000000000000000000000000000000..0ca03f7c1c3732647cdc929243c4532f5d3cabbc Binary files /dev/null and b/framework/tools/hdi-gen/build/hash/hash.o differ diff --git a/framework/tools/hdi-gen/build/lexer/lexer.o b/framework/tools/hdi-gen/build/lexer/lexer.o new file mode 100755 index 0000000000000000000000000000000000000000..d039ca2cc47e3cd32c79ac4ae2e258478cb0990e Binary files /dev/null and b/framework/tools/hdi-gen/build/lexer/lexer.o differ diff --git a/framework/tools/hdi-gen/build/lexer/token.o b/framework/tools/hdi-gen/build/lexer/token.o new file mode 100755 index 0000000000000000000000000000000000000000..55e4e9e40a776e1648fb36b99628614fa949e87d Binary files /dev/null and b/framework/tools/hdi-gen/build/lexer/token.o differ diff --git a/framework/tools/hdi-gen/build/main.o b/framework/tools/hdi-gen/build/main.o new file mode 100755 index 0000000000000000000000000000000000000000..82bc8777a10748e7e1bce0407f9c81f5a6c8cc53 Binary files /dev/null and b/framework/tools/hdi-gen/build/main.o differ diff --git a/framework/tools/hdi-gen/build/parser/parser.o b/framework/tools/hdi-gen/build/parser/parser.o new file mode 100755 index 0000000000000000000000000000000000000000..c12c0e97e6d0284244e1ee95f334ff5fff027111 Binary files /dev/null and b/framework/tools/hdi-gen/build/parser/parser.o differ diff --git a/framework/tools/hdi-gen/build/preprocessor/preprocessor.o b/framework/tools/hdi-gen/build/preprocessor/preprocessor.o new file mode 100755 index 0000000000000000000000000000000000000000..e385e766377080aa4b085ae20178ea5c527c2cb3 Binary files /dev/null and b/framework/tools/hdi-gen/build/preprocessor/preprocessor.o differ diff --git a/framework/tools/hdi-gen/build/util/file.o b/framework/tools/hdi-gen/build/util/file.o new file mode 100755 index 0000000000000000000000000000000000000000..ebb33956eb4bed3f442d3fd195b39c96f109c1c6 Binary files /dev/null and b/framework/tools/hdi-gen/build/util/file.o differ diff --git a/framework/tools/hdi-gen/build/util/light_refcount_base.o b/framework/tools/hdi-gen/build/util/light_refcount_base.o new file mode 100755 index 0000000000000000000000000000000000000000..5ac732b4e8901afc3e403b2c5190e67903f1295e Binary files /dev/null and b/framework/tools/hdi-gen/build/util/light_refcount_base.o differ diff --git a/framework/tools/hdi-gen/build/util/logger.o b/framework/tools/hdi-gen/build/util/logger.o new file mode 100755 index 0000000000000000000000000000000000000000..7a43cba10d092033cde133a0f5e2a14721cf025a Binary files /dev/null and b/framework/tools/hdi-gen/build/util/logger.o differ diff --git a/framework/tools/hdi-gen/build/util/options.o b/framework/tools/hdi-gen/build/util/options.o new file mode 100755 index 0000000000000000000000000000000000000000..8a10ddd73a927780a4a7ca814def0364c61363cc Binary files /dev/null and b/framework/tools/hdi-gen/build/util/options.o differ diff --git a/framework/tools/hdi-gen/build/util/string_builder.o b/framework/tools/hdi-gen/build/util/string_builder.o new file mode 100755 index 0000000000000000000000000000000000000000..3dacea376b52ee8df2fcbafc92bbd18ba1a689fb Binary files /dev/null and b/framework/tools/hdi-gen/build/util/string_builder.o differ diff --git a/framework/tools/hdi-gen/build/util/string_helper.o b/framework/tools/hdi-gen/build/util/string_helper.o new file mode 100755 index 0000000000000000000000000000000000000000..9f4db042af156d4237f51802e7ce41b8688110ae Binary files /dev/null and b/framework/tools/hdi-gen/build/util/string_helper.o differ diff --git a/framework/tools/hdi-gen/codegen/c_client_proxy_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_client_proxy_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_client_proxy_code_emitter.h b/framework/tools/hdi-gen/codegen/c_client_proxy_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_code_emitter.h b/framework/tools/hdi-gen/codegen/c_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_custom_types_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_custom_types_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_custom_types_code_emitter.h b/framework/tools/hdi-gen/codegen/c_custom_types_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_interface_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_interface_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_interface_code_emitter.h b/framework/tools/hdi-gen/codegen/c_interface_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_service_driver_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_service_driver_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_service_driver_code_emitter.h b/framework/tools/hdi-gen/codegen/c_service_driver_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_service_impl_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_service_impl_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_service_impl_code_emitter.h b/framework/tools/hdi-gen/codegen/c_service_impl_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_service_stub_code_emitter.cpp b/framework/tools/hdi-gen/codegen/c_service_stub_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/c_service_stub_code_emitter.h b/framework/tools/hdi-gen/codegen/c_service_stub_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/code_emitter.cpp b/framework/tools/hdi-gen/codegen/code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/code_emitter.h b/framework/tools/hdi-gen/codegen/code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/code_generator.cpp b/framework/tools/hdi-gen/codegen/code_generator.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/code_generator.h b/framework/tools/hdi-gen/codegen/code_generator.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_client_proxy_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_client_proxy_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_client_proxy_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_client_proxy_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_custom_types_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_custom_types_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_custom_types_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_custom_types_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_interface_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_interface_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_interface_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_interface_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_service_driver_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_service_driver_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_service_driver_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_service_driver_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_service_impl_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_service_impl_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_service_impl_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_service_impl_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_service_stub_code_emitter.cpp b/framework/tools/hdi-gen/codegen/cpp_service_stub_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/cpp_service_stub_code_emitter.h b/framework/tools/hdi-gen/codegen/cpp_service_stub_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/java_client_interface_code_emitter.cpp b/framework/tools/hdi-gen/codegen/java_client_interface_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/java_client_interface_code_emitter.h b/framework/tools/hdi-gen/codegen/java_client_interface_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/java_client_proxy_code_emitter.cpp b/framework/tools/hdi-gen/codegen/java_client_proxy_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/java_client_proxy_code_emitter.h b/framework/tools/hdi-gen/codegen/java_client_proxy_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/java_code_emitter.cpp b/framework/tools/hdi-gen/codegen/java_code_emitter.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/codegen/java_code_emitter.h b/framework/tools/hdi-gen/codegen/java_code_emitter.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/face_auth.zip b/framework/tools/hdi-gen/face_auth.zip new file mode 100755 index 0000000000000000000000000000000000000000..fe10bf3ec9ca2fe5798f982161ee26477ac90160 Binary files /dev/null and b/framework/tools/hdi-gen/face_auth.zip differ diff --git a/framework/tools/hdi-gen/face_auth/v1_0/FaceAuthTypes.idl b/framework/tools/hdi-gen/face_auth/v1_0/FaceAuthTypes.idl new file mode 100755 index 0000000000000000000000000000000000000000..10d30c299b48df5dc977225b4b9dc65c2db246e8 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_0/FaceAuthTypes.idl @@ -0,0 +1,177 @@ +/* + * 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. + */ + +/** + * @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.v1_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 1.0 + */ +enum ExecutorRole : int { + /**< 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 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. + * + * @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 Indicates executor information. + * + * @since 3.2 + * @version 1.0 + */ +struct ExecutorInfo { + /**< Indicates the sensor ID, which must be unique within the driver. */ + unsigned short sensorId; + /**< Indicates the executor type. */ + unsigned int executorType; + /**< Indicates the executor role. See @{ExecutorRole}. */ + enum ExecutorRole executorRole; + /**< Indicates the auth type. See @{AuthType}. */ + enum AuthType authType; + /**< Indicates the executor secure level. See @{ExecutorSecureLevel}. */ + enum ExecutorSecureLevel esl; + /**< Indicates the public key of the executor. */ + unsigned char[] publicKey; + /**< Indicates extra information. */ + unsigned char[] extraInfo; +}; + +/** + * @brief Indicates template information. + * + * @since 3.2 + * @version 1.0 + * + * @deprecated + */ +struct TemplateInfo { + /**< Indicates the executor type. */ + unsigned int executorType; + /**< Indicates lockout duration in millisecond. */ + int lockoutDuration; + /**< Indicates remaining authentication attempts before a lockout. */ + int remainAttempts; + /**< Indicates extra information. */ + unsigned char[] extraInfo; +}; +/** @} */ \ No newline at end of file diff --git a/framework/tools/hdi-gen/face_auth/v1_0/IExecutor.idl b/framework/tools/hdi-gen/face_auth/v1_0/IExecutor.idl new file mode 100755 index 0000000000000000000000000000000000000000..4e8fd631af9dda7a603cae7e9abf502843581924 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_0/IExecutor.idl @@ -0,0 +1,158 @@ +/* + * 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. + */ + +/** + * @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 IExecutor.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 3.2 + */ + +package ohos.hdi.face_auth.v1_0; + +import ohos.hdi.face_auth.v1_0.FaceAuthTypes; +import ohos.hdi.face_auth.v1_0.IExecutorCallback; +sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable; + +/** + * @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 3.2 + * @version 1.0 + */ +interface IExecutor { + /** + * @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 Gets template information. + * + * @param templateId Indicates the template ID. + * @param templateInfo Indicates template information. See {@link TemplateInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @deprecated + */ + GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo templateInfo); + /** + * @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 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 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 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 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. + */ + SetBufferProducer([in] BufferProducerSequenceable bufferProducer); +} +/** @} */ \ No newline at end of file diff --git a/framework/tools/hdi-gen/face_auth/v1_0/IExecutorCallback.idl b/framework/tools/hdi-gen/face_auth/v1_0/IExecutorCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..93ef4d54881a6769c2c550933bd1dfa42f435cb6 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_0/IExecutorCallback.idl @@ -0,0 +1,72 @@ +/* + * 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. + */ + +/** + * @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.v1_0; + +import ohos.hdi.face_auth.v1_0.FaceAuthTypes; + +/** + * @brief Defines the callback for an async API, which can be used to report operation results or information + * of the async API. See {@link IExecutor}. + * + * @since 3.2 + * @version 1.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. + */ + 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. + */ + OnTip([in] int tip, [in] unsigned char[] extraInfo); +} +/** @} */ \ No newline at end of file diff --git a/framework/tools/hdi-gen/face_auth/v1_0/IFaceAuthInterface.idl b/framework/tools/hdi-gen/face_auth/v1_0/IFaceAuthInterface.idl new file mode 100755 index 0000000000000000000000000000000000000000..5fa7a533260281c0ce85141fde34cedd189ecacb --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_0/IFaceAuthInterface.idl @@ -0,0 +1,59 @@ +/* + * 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. + */ + +/** + * @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.v1_0; + +import ohos.hdi.face_auth.v1_0.IExecutor; + +/** + * @brief Defines the API for getting the executor list of the face auth driver. + * + * @since 3.2 + * @version 1.0 + */ +interface IFaceAuthInterface { + /** + * @brief Obtains the executor list of the driver. + * + * @param executorList Indicates the executor list of the driver. See {@link IExecutor}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + GetExecutorList([out] IExecutor[] executorList); +} +/** @} */ \ No newline at end of file diff --git a/framework/tools/hdi-gen/face_auth/v1_1/FaceAuthTypes.idl b/framework/tools/hdi-gen/face_auth/v1_1/FaceAuthTypes.idl new file mode 100755 index 0000000000000000000000000000000000000000..ed5c6ed34beff1834ac975f7ccdfd6fc595f1db8 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_1/FaceAuthTypes.idl @@ -0,0 +1,123 @@ +/* + * 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. + */ + +/** + * @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.v1_1; + +/** + * @brief Enumerates get Property types. + * + * @since 4.0 + * @version 1.1 + */ +enum PropertyType : 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 enrollProgress; + /**< 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 1.1 + */ +struct SaCommand { + /**< Indicates sa command id. See {@link SaCommandId}. */ + enum SaCommandId id; + /**< Indicates sa command parameter. See {@link SaCommandParam}. */ + union SaCommandParam param; +}; +/** @} */ \ No newline at end of file diff --git a/framework/tools/hdi-gen/face_auth/v1_1/IExecutor.idl b/framework/tools/hdi-gen/face_auth/v1_1/IExecutor.idl new file mode 100755 index 0000000000000000000000000000000000000000..6c4b4a4233e9c1839846ab4e168fbe06e3786032 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_1/IExecutor.idl @@ -0,0 +1,85 @@ +/* + * 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. + */ + +/** + * @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 IExecutor.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 3.2 + */ + +package ohos.hdi.face_auth.v1_1; + +import ohos.hdi.face_auth.v1_0.FaceAuthTypes; +import ohos.hdi.face_auth.v1_0.IExecutor; +import ohos.hdi.face_auth.v1_1.FaceAuthTypes; +import ohos.hdi.face_auth.v1_1.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 4.0 + * @version 1.1 + */ +interface IExecutor extends ohos.hdi.face_auth.v1_0.IExecutor { + /** + * @brief Get property. + * + * @param templateIdList Indicates the templates to process. + * @param propertyType Indicates the property types to get. See {@link PropertyType}. + * @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] enum PropertyType[] 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/framework/tools/hdi-gen/face_auth/v1_1/IFaceAuthInterface.idl b/framework/tools/hdi-gen/face_auth/v1_1/IFaceAuthInterface.idl new file mode 100755 index 0000000000000000000000000000000000000000..61ab7a92afeb029f1e86b757f2eb608c814b0542 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_1/IFaceAuthInterface.idl @@ -0,0 +1,61 @@ +/* + * 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. + */ + +/** + * @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.v1_1; + +import ohos.hdi.face_auth.v1_0.IFaceAuthInterface; +import ohos.hdi.face_auth.v1_1.IExecutor; + +/** + * @brief Defines the API for getting the executor list of the face auth driver. + * + * @since 4.0 + * @version 1.1 + */ +interface IFaceAuthInterface extends ohos.hdi.face_auth.v1_0.IFaceAuthInterface { +// interface IFaceAuthInterface { + /** + * @brief Obtains the executor list of the driver. + * + * @param executorList Indicates the executor list of the driver. See {@link IExecutor}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + */ + GetExecutorListV1_1([out] IExecutor[] executorList); +} +/** @} */ \ No newline at end of file diff --git a/framework/tools/hdi-gen/face_auth/v1_1/ISaCommandCallback.idl b/framework/tools/hdi-gen/face_auth/v1_1/ISaCommandCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..26cec87fc2c78927d1c441f3d1362012a21cda38 --- /dev/null +++ b/framework/tools/hdi-gen/face_auth/v1_1/ISaCommandCallback.idl @@ -0,0 +1,64 @@ +/* + * 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. + */ + +/** + * @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 ISaCommandCallback.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.v1_1; + +import ohos.hdi.face_auth.v1_1.FaceAuthTypes; + +/** + * @brief Defines the callback for an async API, which can be used to report operation results or information + * of the async API. See {@link IExecutor}. + * + * @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/framework/tools/hdi-gen/foo/v1_0/IFoo.idl b/framework/tools/hdi-gen/foo/v1_0/IFoo.idl new file mode 100755 index 0000000000000000000000000000000000000000..99572ee152dd8b9d6800c195c7223b44619b15cf --- /dev/null +++ b/framework/tools/hdi-gen/foo/v1_0/IFoo.idl @@ -0,0 +1,7 @@ +package ohos.hdi.foo.v1_0; + +import ohos.hdi.foo.v1_0.IFooCallback; + +interface IFoo { + SendCallback([in] IFooCallback cb); +}; \ No newline at end of file diff --git a/framework/tools/hdi-gen/foo/v1_0/IFooCallback.idl b/framework/tools/hdi-gen/foo/v1_0/IFooCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..3a44ea99192b9790f811c535e19c4ba9bff8dc3b --- /dev/null +++ b/framework/tools/hdi-gen/foo/v1_0/IFooCallback.idl @@ -0,0 +1,5 @@ +package ohos.hdi.foo.v1_0; + +[callback] interface IFooCallback { + Ping(); +}; \ No newline at end of file diff --git a/framework/tools/hdi-gen/foo/v1_1/IFoo.idl b/framework/tools/hdi-gen/foo/v1_1/IFoo.idl new file mode 100755 index 0000000000000000000000000000000000000000..e8236e441279a5c3667781b276a38b5afcd67e52 --- /dev/null +++ b/framework/tools/hdi-gen/foo/v1_1/IFoo.idl @@ -0,0 +1,10 @@ +package ohos.hdi.foo.v1_1; + +import ohos.hdi.foo.v1_0.IFoo; +import ohos.hdi.foo.v1_1.IFooCallback; + +interface IFoo extends ohos.hdi.foo.v1_0.IFoo { + SendCallback2([in] ohos.hdi.foo.v1_1.IFooCallback cb); + + SendCallback3([in] IFooCallback[] cb); +}; diff --git a/framework/tools/hdi-gen/foo/v1_1/IFooCallback.idl b/framework/tools/hdi-gen/foo/v1_1/IFooCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..7619fb7d8e3920289e2a9d03720ab0d3a96df742 --- /dev/null +++ b/framework/tools/hdi-gen/foo/v1_1/IFooCallback.idl @@ -0,0 +1,7 @@ +package ohos.hdi.foo.v1_1; + +import ohos.hdi.foo.v1_0.IFooCallback; + +[callback] interface IFooCallback extends ohos.hdi.foo.v1_0.IFooCallback { + Ping2(); +}; \ No newline at end of file diff --git a/framework/tools/hdi-gen/hash/hash.cpp b/framework/tools/hdi-gen/hash/hash.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/hash/hash.h b/framework/tools/hdi-gen/hash/hash.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/hdi-gen b/framework/tools/hdi-gen/hdi-gen new file mode 100755 index 0000000000000000000000000000000000000000..ec870cbd9b1336ba46d22f23b0c4abbf4f9eb9f3 Binary files /dev/null and b/framework/tools/hdi-gen/hdi-gen differ diff --git a/framework/tools/hdi-gen/lexer/lexer.cpp b/framework/tools/hdi-gen/lexer/lexer.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/lexer/lexer.h b/framework/tools/hdi-gen/lexer/lexer.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/lexer/token.cpp b/framework/tools/hdi-gen/lexer/token.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/lexer/token.h b/framework/tools/hdi-gen/lexer/token.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/main.cpp b/framework/tools/hdi-gen/main.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_driver.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_driver.cpp new file mode 100755 index 0000000000000000000000000000000000000000..1bb6757ade52ffc54cfb61e8b463c5c23802d031 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_driver.cpp @@ -0,0 +1,117 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "v1_1/executor_stub.h" + +#define HDF_LOG_TAG executor_driver + +using namespace OHOS::HDI::FaceAuth::V1_1; + +struct HdfExecutorHost { + struct IDeviceIoService ioService; + OHOS::sptr stub; +}; + +static int32_t ExecutorDriverDispatch(struct HdfDeviceIoClient *client, int cmdId, struct HdfSBuf *data, + struct HdfSBuf *reply) +{ + auto *hdfExecutorHost = CONTAINER_OF(client->device->service, struct HdfExecutorHost, ioService); + + OHOS::MessageParcel *dataParcel = nullptr; + OHOS::MessageParcel *replyParcel = nullptr; + OHOS::MessageOption option; + + if (SbufToParcel(data, &dataParcel) != HDF_SUCCESS) { + HDF_LOGE("%{public}s: invalid data sbuf object to dispatch", __func__); + return HDF_ERR_INVALID_PARAM; + } + if (SbufToParcel(reply, &replyParcel) != HDF_SUCCESS) { + HDF_LOGE("%{public}s: invalid reply sbuf object to dispatch", __func__); + return HDF_ERR_INVALID_PARAM; + } + + return hdfExecutorHost->stub->SendRequest(cmdId, *dataParcel, *replyParcel, option); +} + +static int HdfExecutorDriverInit(struct HdfDeviceObject *deviceObject) +{ + HDF_LOGI("%{public}s: driver init start", __func__); + return HDF_SUCCESS; +} + +static int HdfExecutorDriverBind(struct HdfDeviceObject *deviceObject) +{ + HDF_LOGI("%{public}s: driver bind start", __func__); + auto *hdfExecutorHost = new (std::nothrow) HdfExecutorHost; + if (hdfExecutorHost == nullptr) { + HDF_LOGE("%{public}s: failed to create create HdfExecutorHost object", __func__); + return HDF_FAILURE; + } + + hdfExecutorHost->ioService.Dispatch = ExecutorDriverDispatch; + hdfExecutorHost->ioService.Open = NULL; + hdfExecutorHost->ioService.Release = NULL; + + auto serviceImpl = OHOS::HDI::FaceAuth::V1_1::IExecutor::Get(true); + if (serviceImpl == nullptr) { + HDF_LOGE("%{public}s: failed to get of implement service", __func__); + delete hdfExecutorHost; + return HDF_FAILURE; + } + + hdfExecutorHost->stub = OHOS::HDI::ObjectCollector::GetInstance().GetOrNewObject(serviceImpl, + OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()); + if (hdfExecutorHost->stub == nullptr) { + HDF_LOGE("%{public}s: failed to get stub object", __func__); + delete hdfExecutorHost; + return HDF_FAILURE; + } + + deviceObject->service = &hdfExecutorHost->ioService; + return HDF_SUCCESS; +} + +static void HdfExecutorDriverRelease(struct HdfDeviceObject *deviceObject) +{ + HDF_LOGI("%{public}s: driver release start", __func__); + if (deviceObject->service == nullptr) { + return; + } + + auto *hdfExecutorHost = CONTAINER_OF(deviceObject->service, struct HdfExecutorHost, ioService); + if (hdfExecutorHost != nullptr) { + delete hdfExecutorHost; + } +} + +struct HdfDriverEntry g_executorDriverEntry = { + .moduleVersion = 1, + .moduleName = "", + .Bind = HdfExecutorDriverBind, + .Init = HdfExecutorDriverInit, + .Release = HdfExecutorDriverRelease, +}; + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +HDF_INIT(g_executorDriverEntry); +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_proxy.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_proxy.cpp new file mode 100755 index 0000000000000000000000000000000000000000..f3d117e37452a24dd5e8be209f0be7074f39e6c9 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_proxy.cpp @@ -0,0 +1,276 @@ +/* + * 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. + */ + +#include "v1_1/executor_proxy.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#define HDF_LOG_TAG executor_proxy + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +template +static bool WritePodArray(MessageParcel &parcel, const std::vector &data); + +sptr OHOS::HDI::FaceAuth::V1_1::IExecutor::Get(bool isStub) +{ + return IExecutor::Get("executor_service", isStub); +} + +sptr OHOS::HDI::FaceAuth::V1_1::IExecutor::Get(const std::string& serviceName, bool isStub) +{ + if (isStub) { + std::string desc = Str16ToStr8(OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()); + void *impl = LoadHdiImpl(desc.c_str(), serviceName == "executor_service" ? "service" : serviceName.c_str()); + if (impl == nullptr) { + HDF_LOGE("failed to load hdi impl %{public}s", desc.data()); + return nullptr; + } + return reinterpret_cast(impl); + } + + using namespace OHOS::HDI::ServiceManager::V1_0; + auto servMgr = IServiceManager::Get(); + if (servMgr == nullptr) { + HDF_LOGE("%{public}s:get IServiceManager failed!", __func__); + return nullptr; + } + + sptr remote = servMgr->GetService(serviceName.c_str()); + if (remote == nullptr) { + HDF_LOGE("%{public}s:get remote object failed!", __func__); + return nullptr; + } + + sptr proxy = OHOS::HDI::hdi_facecast(remote); + if (proxy == nullptr) { + HDF_LOGE("%{public}s:iface_cast failed!", __func__); + return nullptr; + } + + uint32_t serMajorVer = 0; + uint32_t serMinorVer = 0; + int32_t executorRet = proxy->GetVersion(serMajorVer, serMinorVer); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s:get version failed!", __func__); + return nullptr; + } + + if (serMajorVer != 1 || serMinorVer < 1) { + HDF_LOGE("%{public}s:check version failed! version of service:%u.%u, version of client:1.1", __func__, serMajorVer, serMinorVer); + return nullptr; + } + + return proxy; +} + + +template +static bool WritePodArray(MessageParcel &parcel, const std::vector &data) +{ + if (!parcel.WriteUint32(data.size())) { + HDF_LOGE("%{public}s: failed to write data size", __func__); + return false; + } + if (data.empty()) { + return true; + } + if (!parcel.WriteUnpadBuffer((const void*)data.data(), sizeof(ElementType) * data.size())) { + HDF_LOGE("%{public}s: failed to write array", __func__); + return false; + } + return true; +} +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::GetProperty(const std::vector& templateIdList, + const std::vector& propertyTypes, Property& property) +{ + return OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::GetProperty_(templateIdList, propertyTypes, property, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::SetCachedTemplates(const std::vector& templateIdList) +{ + return OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::SetCachedTemplates_(templateIdList, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::RegisterSaCommandCallback(const sptr& callbackObj) +{ + return OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::RegisterSaCommandCallback_(callbackObj, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::GetExecutorInfo(ExecutorInfo& executorInfo) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::GetExecutorInfo_(executorInfo, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::GetTemplateInfo(uint64_t templateId, TemplateInfo& templateInfo) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::GetTemplateInfo_(templateId, templateInfo, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::OnRegisterFinish(const std::vector& templateIdList, + const std::vector& frameworkPublicKey, const std::vector& extraInfo) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::OnRegisterFinish_(templateIdList, frameworkPublicKey, extraInfo, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::Enroll(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::Enroll_(scheduleId, extraInfo, callbackObj, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::Authenticate(uint64_t scheduleId, + const std::vector& templateIdList, const std::vector& extraInfo, const sptr& callbackObj) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::Authenticate_(scheduleId, templateIdList, extraInfo, callbackObj, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::Identify(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::Identify_(scheduleId, extraInfo, callbackObj, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::Delete(const std::vector& templateIdList) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::Delete_(templateIdList, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::Cancel(uint64_t scheduleId) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::Cancel_(scheduleId, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::SendCommand(int32_t commandId, const std::vector& extraInfo, + const sptr& callbackObj) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::SendCommand_(commandId, extraInfo, callbackObj, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::SetBufferProducer(const sptr& bufferProducer) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::SetBufferProducer_(bufferProducer, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::GetVersion(uint32_t& majorVer, uint32_t& minorVer) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorProxy::GetVersion_(majorVer, minorVer, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::GetProperty_(const std::vector& templateIdList, + const std::vector& propertyTypes, Property& property, const sptr remote) +{ + MessageParcel executorData; + MessageParcel executorReply; + MessageOption executorOption(MessageOption::TF_SYNC); + + if (!executorData.WriteInterfaceToken(OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor())) { + HDF_LOGE("%{public}s: failed to write interface descriptor!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!WritePodArray(executorData, templateIdList)) { + HDF_LOGE("%{public}s: failed to write templateIdList", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!WritePodArray(executorData, propertyTypes)) { + HDF_LOGE("%{public}s: failed to write propertyTypes", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t executorRet = remote->SendRequest(CMD_EXECUTOR_GET_PROPERTY, executorData, executorReply, executorOption); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %{public}d", __func__, executorRet); + return executorRet; + } + + if (!PropertyBlockUnmarshalling(executorReply, property)) { + HDF_LOGE("%{public}s: read property failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + return executorRet; +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::SetCachedTemplates_(const std::vector& templateIdList, + const sptr remote) +{ + MessageParcel executorData; + MessageParcel executorReply; + MessageOption executorOption(MessageOption::TF_SYNC); + + if (!executorData.WriteInterfaceToken(OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor())) { + HDF_LOGE("%{public}s: failed to write interface descriptor!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!WritePodArray(executorData, templateIdList)) { + HDF_LOGE("%{public}s: failed to write templateIdList", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t executorRet = remote->SendRequest(CMD_EXECUTOR_SET_CACHED_TEMPLATES, executorData, executorReply, executorOption); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %{public}d", __func__, executorRet); + return executorRet; + } + + return executorRet; +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorProxy::RegisterSaCommandCallback_(const sptr& callbackObj, const sptr remote) +{ + MessageParcel executorData; + MessageParcel executorReply; + MessageOption executorOption(MessageOption::TF_SYNC); + + if (!executorData.WriteInterfaceToken(OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor())) { + HDF_LOGE("%{public}s: failed to write interface descriptor!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (callbackObj == nullptr) { + HDF_LOGE("%{public}s: parameter callbackObj is nullptr!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!executorData.WriteRemoteObject(OHOS::HDI::ObjectCollector::GetInstance().GetOrNewObject(callbackObj, OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback::GetDescriptor()))) { + HDF_LOGE("%{public}s: write callbackObj failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t executorRet = remote->SendRequest(CMD_EXECUTOR_REGISTER_SA_COMMAND_CALLBACK, executorData, executorReply, executorOption); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %{public}d", __func__, executorRet); + return executorRet; + } + + return executorRet; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_proxy.h b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_proxy.h new file mode 100755 index 0000000000000000000000000000000000000000..3f052118fac5af1062a4dd86980d996553cb63c9 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_proxy.h @@ -0,0 +1,85 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_EXECUTORPROXY_H +#define OHOS_HDI_FACE_AUTH_V1_1_EXECUTORPROXY_H + +#include "v1_0/executor_proxy.h" +#include "v1_1/iexecutor.h" +#include + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +class ExecutorProxy : public IProxyBroker { +public: + explicit ExecutorProxy(const sptr& remote) : IProxyBroker(remote) {} + + virtual ~ExecutorProxy() = default; + + int32_t GetProperty(const std::vector& templateIdList, const std::vector& propertyTypes, + Property& property) override; + + int32_t SetCachedTemplates(const std::vector& templateIdList) override; + + int32_t RegisterSaCommandCallback(const sptr& callbackObj) override; + + int32_t GetExecutorInfo(ExecutorInfo& executorInfo) override; + + int32_t GetTemplateInfo(uint64_t templateId, TemplateInfo& templateInfo) override; + + int32_t OnRegisterFinish(const std::vector& templateIdList, + const std::vector& frameworkPublicKey, const std::vector& extraInfo) override; + + int32_t Enroll(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) override; + + int32_t Authenticate(uint64_t scheduleId, const std::vector& templateIdList, + const std::vector& extraInfo, const sptr& callbackObj) override; + + int32_t Identify(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) override; + + int32_t Delete(const std::vector& templateIdList) override; + + int32_t Cancel(uint64_t scheduleId) override; + + int32_t SendCommand(int32_t commandId, const std::vector& extraInfo, + const sptr& callbackObj) override; + + int32_t SetBufferProducer(const sptr& bufferProducer) override; + + int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) override; + + static int32_t GetProperty_(const std::vector& templateIdList, + const std::vector& propertyTypes, Property& property, const sptr remote); + + static int32_t SetCachedTemplates_(const std::vector& templateIdList, const sptr remote); + + static int32_t RegisterSaCommandCallback_(const sptr& callbackObj, + const sptr remote); + +private: + static inline BrokerDelegator delegator_; +}; + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_EXECUTORPROXY_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_service.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_service.cpp new file mode 100755 index 0000000000000000000000000000000000000000..26a1a269f7202086f681dd0eafd22a995193750c --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_service.cpp @@ -0,0 +1,104 @@ +/* + * 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. + */ + +#include "v1_1/executor_service.h" +#include + +#define HDF_LOG_TAG executor_service + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +extern "C" IExecutor *ExecutorImplGetInstance(void) +{ + return new (std::nothrow) ExecutorService(); +} + +int32_t ExecutorService::GetProperty(const std::vector& templateIdList, + const std::vector& propertyTypes, Property& property) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::SetCachedTemplates(const std::vector& templateIdList) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::RegisterSaCommandCallback(const sptr& callbackObj) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::GetExecutorInfo(ExecutorInfo& executorInfo) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::GetTemplateInfo(uint64_t templateId, TemplateInfo& templateInfo) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::OnRegisterFinish(const std::vector& templateIdList, + const std::vector& frameworkPublicKey, const std::vector& extraInfo) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::Enroll(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::Authenticate(uint64_t scheduleId, const std::vector& templateIdList, + const std::vector& extraInfo, const sptr& callbackObj) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::Identify(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::Delete(const std::vector& templateIdList) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::Cancel(uint64_t scheduleId) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::SendCommand(int32_t commandId, const std::vector& extraInfo, + const sptr& callbackObj) +{ + return HDF_SUCCESS; +} + +int32_t ExecutorService::SetBufferProducer(const sptr& bufferProducer) +{ + return HDF_SUCCESS; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_service.h b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_service.h new file mode 100755 index 0000000000000000000000000000000000000000..913749ac3f60cc15c7aaa1fe4ce32f84a7515080 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_service.h @@ -0,0 +1,68 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_EXECUTORSERVICE_H +#define OHOS_HDI_FACE_AUTH_V1_1_EXECUTORSERVICE_H + +#include "v1_1/iexecutor.h" + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +class ExecutorService : public OHOS::HDI::FaceAuth::V1_1::IExecutor { +public: + ExecutorService() = default; + virtual ~ExecutorService() = default; + + int32_t GetProperty(const std::vector& templateIdList, const std::vector& propertyTypes, + Property& property) override; + + int32_t SetCachedTemplates(const std::vector& templateIdList) override; + + int32_t RegisterSaCommandCallback(const sptr& callbackObj) override; + + int32_t GetExecutorInfo(ExecutorInfo& executorInfo) override; + + int32_t GetTemplateInfo(uint64_t templateId, TemplateInfo& templateInfo) override; + + int32_t OnRegisterFinish(const std::vector& templateIdList, + const std::vector& frameworkPublicKey, const std::vector& extraInfo) override; + + int32_t Enroll(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) override; + + int32_t Authenticate(uint64_t scheduleId, const std::vector& templateIdList, + const std::vector& extraInfo, const sptr& callbackObj) override; + + int32_t Identify(uint64_t scheduleId, const std::vector& extraInfo, + const sptr& callbackObj) override; + + int32_t Delete(const std::vector& templateIdList) override; + + int32_t Cancel(uint64_t scheduleId) override; + + int32_t SendCommand(int32_t commandId, const std::vector& extraInfo, + const sptr& callbackObj) override; + + int32_t SetBufferProducer(const sptr& bufferProducer) override; + +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_EXECUTORSERVICE_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_stub.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_stub.cpp new file mode 100755 index 0000000000000000000000000000000000000000..74b8e7b60150c6fdaf418c2a7b5be186c3952970 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_stub.cpp @@ -0,0 +1,294 @@ +/* + * 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. + */ + +#include "v1_1/executor_stub.h" +#include +#include +#include +#include +#include +#include + +#define HDF_LOG_TAG executor_stub + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +template +static bool ReadInterface(MessageParcel &parcel, sptr& object); +template +static bool ReadPodArray(MessageParcel &parcel, std::vector &data); + + +template +static bool ReadInterface(MessageParcel &parcel, sptr& object) +{ + sptr remote = parcel.ReadRemoteObject(); + if (remote == nullptr) { + HDF_LOGE("%{public}s: read an invalid remote object", __func__); + return false; + } + + object = hdi_facecast(remote); + if (object == nullptr) { + HDF_LOGE("%{public}s: failed to cast interface object", __func__); + return false; + } + return true; +} + +template +static bool ReadPodArray(MessageParcel &parcel, std::vector &data) +{ + data.clear(); + uint32_t size = 0; + if (!parcel.ReadUint32(size)) { + HDF_LOGE("%{public}s: failed to read size", __func__); + return false; + } + + if (size == 0) { + return true; + } + const ElementType *dataPtr = reinterpret_cast(parcel.ReadUnpadBuffer(sizeof(ElementType) * size)); + if (dataPtr == nullptr) { + HDF_LOGI("%{public}s: failed to read data", __func__); + return false; + } + data.assign(dataPtr, dataPtr + size); + return true; +} + +sptr OHOS::HDI::FaceAuth::V1_1::IExecutor::Get(bool isStub) +{ + return OHOS::HDI::FaceAuth::V1_1::IExecutor::Get("executor_service", isStub); +} + +sptr OHOS::HDI::FaceAuth::V1_1::IExecutor::Get(const std::string& serviceName, bool isStub) +{ + if (!isStub) { + return nullptr; + } + std::string desc = Str16ToStr8(OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()); + void *impl = LoadHdiImpl(desc.c_str(), serviceName == "executor_service" ? "service" : serviceName.c_str()); + if (impl == nullptr) { + HDF_LOGE("failed to load hdi impl %{public}s", desc.c_str()); + return nullptr; + } + return reinterpret_cast(impl); +} + + +OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStub(const sptr &impl) + : IPCObjectStub(OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()), impl_(impl) +{ +} + +OHOS::HDI::FaceAuth::V1_1::ExecutorStub::~ExecutorStub() +{ + ObjectCollector::GetInstance().RemoveObject(impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) +{ + switch (code) { + case CMD_EXECUTOR_GET_VERSION: + return ExecutorStubGetVersion(data, reply, option); + case CMD_EXECUTOR_GET_PROPERTY: + return ExecutorStubGetProperty(data, reply, option); + case CMD_EXECUTOR_SET_CACHED_TEMPLATES: + return ExecutorStubSetCachedTemplates(data, reply, option); + case CMD_EXECUTOR_REGISTER_SA_COMMAND_CALLBACK: + return ExecutorStubRegisterSaCommandCallback(data, reply, option); + case CMD_EXECUTOR_GET_EXECUTOR_INFO: + return ExecutorStubGetExecutorInfo(data, reply, option); + case CMD_EXECUTOR_GET_TEMPLATE_INFO: + return ExecutorStubGetTemplateInfo(data, reply, option); + case CMD_EXECUTOR_ON_REGISTER_FINISH: + return ExecutorStubOnRegisterFinish(data, reply, option); + case CMD_EXECUTOR_ENROLL: + return ExecutorStubEnroll(data, reply, option); + case CMD_EXECUTOR_AUTHENTICATE: + return ExecutorStubAuthenticate(data, reply, option); + case CMD_EXECUTOR_IDENTIFY: + return ExecutorStubIdentify(data, reply, option); + case CMD_EXECUTOR_DELETE: + return ExecutorStubDelete(data, reply, option); + case CMD_EXECUTOR_CANCEL: + return ExecutorStubCancel(data, reply, option); + case CMD_EXECUTOR_SEND_COMMAND: + return ExecutorStubSendCommand(data, reply, option); + case CMD_EXECUTOR_SET_BUFFER_PRODUCER: + return ExecutorStubSetBufferProducer(data, reply, option); + default: { + HDF_LOGE("%{public}s: cmd %{public}d is not supported", __func__, code); + return IPCObjectStub::OnRemoteRequest(code, data, reply, option); + } + } +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubGetProperty(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubGetProperty_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubSetCachedTemplates(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubSetCachedTemplates_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubRegisterSaCommandCallback(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubRegisterSaCommandCallback_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubGetExecutorInfo(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubGetExecutorInfo_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubGetTemplateInfo(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubGetTemplateInfo_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubOnRegisterFinish(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubOnRegisterFinish_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubEnroll(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubEnroll_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubAuthenticate(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubAuthenticate_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubIdentify(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubIdentify_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubDelete(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubDelete_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubCancel(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubCancel_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubSendCommand(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubSendCommand_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubSetBufferProducer(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubSetBufferProducer_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubGetVersion(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption) +{ + return OHOS::HDI::FaceAuth::V1_0::ExecutorStub::ExecutorStubGetVersion_(executorData, executorReply, executorOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubGetProperty_(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption, sptr impl) +{ + if (executorData.ReadInterfaceToken() != OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()) { + HDF_LOGE("%{public}s: interface token check failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + std::vector templateIdList; + if (!ReadPodArray(executorData, templateIdList)) { + HDF_LOGE("%{public}s: failed to read templateIdList", __func__); + return HDF_ERR_INVALID_PARAM; + } + + std::vector propertyTypes; + if (!ReadPodArray(executorData, propertyTypes)) { + HDF_LOGE("%{public}s: failed to read propertyTypes", __func__); + return HDF_ERR_INVALID_PARAM; + } + + Property property; + + int32_t executorRet = impl->GetProperty(templateIdList, propertyTypes, property); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %d", __func__, executorRet); + return executorRet; + } + + if (!PropertyBlockMarshalling(executorReply, property)) { + HDF_LOGE("%{public}s: write property failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + return executorRet; +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubSetCachedTemplates_(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption, sptr impl) +{ + if (executorData.ReadInterfaceToken() != OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()) { + HDF_LOGE("%{public}s: interface token check failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + std::vector templateIdList; + if (!ReadPodArray(executorData, templateIdList)) { + HDF_LOGE("%{public}s: failed to read templateIdList", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t executorRet = impl->SetCachedTemplates(templateIdList); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %d", __func__, executorRet); + return executorRet; + } + + return executorRet; +} + +int32_t OHOS::HDI::FaceAuth::V1_1::ExecutorStub::ExecutorStubRegisterSaCommandCallback_(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption, sptr impl) +{ + if (executorData.ReadInterfaceToken() != OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()) { + HDF_LOGE("%{public}s: interface token check failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + sptr callbackObj; + if (!ReadInterface(executorData, callbackObj)) { + HDF_LOGE("%{public}s: failed to read interface object", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t executorRet = impl->RegisterSaCommandCallback(callbackObj); + if (executorRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %d", __func__, executorRet); + return executorRet; + } + + return executorRet; +} +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/executor_stub.h b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_stub.h new file mode 100755 index 0000000000000000000000000000000000000000..6305d2debfa3c9ffd52f7addacc89e38dd327d48 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/executor_stub.h @@ -0,0 +1,84 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_EXECUTORSTUB_H +#define OHOS_HDI_FACE_AUTH_V1_1_EXECUTORSTUB_H + +#include +#include +#include +#include +#include +#include "v1_0/executor_stub.h" +#include "v1_1/iexecutor.h" + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +using namespace OHOS; +class ExecutorStub : public IPCObjectStub { +public: + explicit ExecutorStub(const sptr &impl); + virtual ~ExecutorStub(); + + int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; + + static int32_t ExecutorStubGetProperty_(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption, sptr impl); + + static int32_t ExecutorStubSetCachedTemplates_(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption, sptr impl); + + static int32_t ExecutorStubRegisterSaCommandCallback_(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption, sptr impl); + +private: + int32_t ExecutorStubGetProperty(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubSetCachedTemplates(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubRegisterSaCommandCallback(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubGetExecutorInfo(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubGetTemplateInfo(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubOnRegisterFinish(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubEnroll(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubAuthenticate(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubIdentify(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubDelete(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubCancel(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubSendCommand(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubSetBufferProducer(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + int32_t ExecutorStubGetVersion(MessageParcel& executorData, MessageParcel& executorReply, MessageOption& executorOption); + + + static inline ObjectDelegator objDelegator_; + sptr impl_; +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_EXECUTORSTUB_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_driver.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_driver.cpp new file mode 100755 index 0000000000000000000000000000000000000000..3c062cd243bcbb105399721d851154dc838fb428 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_driver.cpp @@ -0,0 +1,117 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include "v1_1/face_auth_interface_stub.h" + +#define HDF_LOG_TAG face_auth_interface_driver + +using namespace OHOS::HDI::FaceAuth::V1_1; + +struct HdfFaceAuthInterfaceHost { + struct IDeviceIoService ioService; + OHOS::sptr stub; +}; + +static int32_t FaceAuthInterfaceDriverDispatch(struct HdfDeviceIoClient *client, int cmdId, struct HdfSBuf *data, + struct HdfSBuf *reply) +{ + auto *hdfFaceAuthInterfaceHost = CONTAINER_OF(client->device->service, struct HdfFaceAuthInterfaceHost, ioService); + + OHOS::MessageParcel *dataParcel = nullptr; + OHOS::MessageParcel *replyParcel = nullptr; + OHOS::MessageOption option; + + if (SbufToParcel(data, &dataParcel) != HDF_SUCCESS) { + HDF_LOGE("%{public}s: invalid data sbuf object to dispatch", __func__); + return HDF_ERR_INVALID_PARAM; + } + if (SbufToParcel(reply, &replyParcel) != HDF_SUCCESS) { + HDF_LOGE("%{public}s: invalid reply sbuf object to dispatch", __func__); + return HDF_ERR_INVALID_PARAM; + } + + return hdfFaceAuthInterfaceHost->stub->SendRequest(cmdId, *dataParcel, *replyParcel, option); +} + +static int HdfFaceAuthInterfaceDriverInit(struct HdfDeviceObject *deviceObject) +{ + HDF_LOGI("%{public}s: driver init start", __func__); + return HDF_SUCCESS; +} + +static int HdfFaceAuthInterfaceDriverBind(struct HdfDeviceObject *deviceObject) +{ + HDF_LOGI("%{public}s: driver bind start", __func__); + auto *hdfFaceAuthInterfaceHost = new (std::nothrow) HdfFaceAuthInterfaceHost; + if (hdfFaceAuthInterfaceHost == nullptr) { + HDF_LOGE("%{public}s: failed to create create HdfFaceAuthInterfaceHost object", __func__); + return HDF_FAILURE; + } + + hdfFaceAuthInterfaceHost->ioService.Dispatch = FaceAuthInterfaceDriverDispatch; + hdfFaceAuthInterfaceHost->ioService.Open = NULL; + hdfFaceAuthInterfaceHost->ioService.Release = NULL; + + auto serviceImpl = OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::Get(true); + if (serviceImpl == nullptr) { + HDF_LOGE("%{public}s: failed to get of implement service", __func__); + delete hdfFaceAuthInterfaceHost; + return HDF_FAILURE; + } + + hdfFaceAuthInterfaceHost->stub = OHOS::HDI::ObjectCollector::GetInstance().GetOrNewObject(serviceImpl, + OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::GetDescriptor()); + if (hdfFaceAuthInterfaceHost->stub == nullptr) { + HDF_LOGE("%{public}s: failed to get stub object", __func__); + delete hdfFaceAuthInterfaceHost; + return HDF_FAILURE; + } + + deviceObject->service = &hdfFaceAuthInterfaceHost->ioService; + return HDF_SUCCESS; +} + +static void HdfFaceAuthInterfaceDriverRelease(struct HdfDeviceObject *deviceObject) +{ + HDF_LOGI("%{public}s: driver release start", __func__); + if (deviceObject->service == nullptr) { + return; + } + + auto *hdfFaceAuthInterfaceHost = CONTAINER_OF(deviceObject->service, struct HdfFaceAuthInterfaceHost, ioService); + if (hdfFaceAuthInterfaceHost != nullptr) { + delete hdfFaceAuthInterfaceHost; + } +} + +struct HdfDriverEntry g_faceauthinterfaceDriverEntry = { + .moduleVersion = 1, + .moduleName = "", + .Bind = HdfFaceAuthInterfaceDriverBind, + .Init = HdfFaceAuthInterfaceDriverInit, + .Release = HdfFaceAuthInterfaceDriverRelease, +}; + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +HDF_INIT(g_faceauthinterfaceDriverEntry); +#ifdef __cplusplus +} +#endif /* __cplusplus */ diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_proxy.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_proxy.cpp new file mode 100755 index 0000000000000000000000000000000000000000..cfbe1de0d95435359b7b080d919f80963555d749 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_proxy.cpp @@ -0,0 +1,166 @@ +/* + * 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. + */ + +#include "v1_1/face_auth_interface_proxy.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#define HDF_LOG_TAG face_auth_interface_proxy + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +template +static bool ReadInterface(MessageParcel &parcel, sptr& object); + +sptr OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::Get(bool isStub) +{ + return IFaceAuthInterface::Get("face_auth_interface_service", isStub); +} + +sptr OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::Get(const std::string& serviceName, bool isStub) +{ + if (isStub) { + std::string desc = Str16ToStr8(OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::GetDescriptor()); + void *impl = LoadHdiImpl(desc.c_str(), serviceName == "face_auth_interface_service" ? "service" : serviceName.c_str()); + if (impl == nullptr) { + HDF_LOGE("failed to load hdi impl %{public}s", desc.data()); + return nullptr; + } + return reinterpret_cast(impl); + } + + using namespace OHOS::HDI::ServiceManager::V1_0; + auto servMgr = IServiceManager::Get(); + if (servMgr == nullptr) { + HDF_LOGE("%{public}s:get IServiceManager failed!", __func__); + return nullptr; + } + + sptr remote = servMgr->GetService(serviceName.c_str()); + if (remote == nullptr) { + HDF_LOGE("%{public}s:get remote object failed!", __func__); + return nullptr; + } + + sptr proxy = OHOS::HDI::hdi_facecast(remote); + if (proxy == nullptr) { + HDF_LOGE("%{public}s:iface_cast failed!", __func__); + return nullptr; + } + + uint32_t serMajorVer = 0; + uint32_t serMinorVer = 0; + int32_t faceAuthInterfaceRet = proxy->GetVersion(serMajorVer, serMinorVer); + if (faceAuthInterfaceRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s:get version failed!", __func__); + return nullptr; + } + + if (serMajorVer != 1 || serMinorVer < 1) { + HDF_LOGE("%{public}s:check version failed! version of service:%u.%u, version of client:1.1", __func__, serMajorVer, serMinorVer); + return nullptr; + } + + return proxy; +} + + +template +static bool ReadInterface(MessageParcel &parcel, sptr& object) +{ + sptr remote = parcel.ReadRemoteObject(); + if (remote == nullptr) { + HDF_LOGE("%{public}s: read an invalid remote object", __func__); + return false; + } + + object = hdi_facecast(remote); + if (object == nullptr) { + HDF_LOGE("%{public}s: failed to cast interface object", __func__); + return false; + } + return true; +} +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceProxy::GetExecutorListV1_1(std::vector>& executorList) +{ + return OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceProxy::GetExecutorListV1_1_(executorList, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceProxy::GetExecutorList(std::vector>& executorList) +{ + return OHOS::HDI::FaceAuth::V1_0::FaceAuthInterfaceProxy::GetExecutorList_(executorList, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceProxy::GetVersion(uint32_t& majorVer, uint32_t& minorVer) +{ + return OHOS::HDI::FaceAuth::V1_0::FaceAuthInterfaceProxy::GetVersion_(majorVer, minorVer, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceProxy::GetExecutorListV1_1_(std::vector>& executorList, const sptr remote) +{ + MessageParcel faceAuthInterfaceData; + MessageParcel faceAuthInterfaceReply; + MessageOption faceAuthInterfaceOption(MessageOption::TF_SYNC); + + if (!faceAuthInterfaceData.WriteInterfaceToken(OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::GetDescriptor())) { + HDF_LOGE("%{public}s: failed to write interface descriptor!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!faceAuthInterfaceData.WriteBool(false)) { + HDF_LOGE("%{public}s:failed to write flag of memory setting!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t faceAuthInterfaceRet = remote->SendRequest(CMD_FACE_AUTH_INTERFACE_GET_EXECUTOR_LIST_V1_1, faceAuthInterfaceData, faceAuthInterfaceReply, faceAuthInterfaceOption); + if (faceAuthInterfaceRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %{public}d", __func__, faceAuthInterfaceRet); + return faceAuthInterfaceRet; + } + + uint32_t executorListSize = 0; + if (!faceAuthInterfaceReply.ReadUint32(executorListSize)) { + HDF_LOGE("%{public}s: failed to read size", __func__); + return HDF_ERR_INVALID_PARAM; + } + + HDI_CHECK_VALUE_RETURN(executorListSize, >, HDI_BUFF_MAX_SIZE / sizeof(sptr), HDF_ERR_INVALID_PARAM); + executorList.clear(); + executorList.reserve(executorListSize); + for (uint32_t i0 = 0; i0 < executorListSize; ++i0) { + sptr value0; + if (!ReadInterface(faceAuthInterfaceReply, value0)) { + HDF_LOGE("%{public}s: failed to read interface object", __func__); + return HDF_ERR_INVALID_PARAM; + } + executorList.push_back(value0); + } + + return faceAuthInterfaceRet; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_proxy.h b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_proxy.h new file mode 100755 index 0000000000000000000000000000000000000000..deb0ad9524f750aec812e713e97fb1cbb4bcb24a --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_proxy.h @@ -0,0 +1,52 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACEPROXY_H +#define OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACEPROXY_H + +#include "v1_0/face_auth_interface_proxy.h" +#include "v1_1/iface_auth_interface.h" +#include + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +class FaceAuthInterfaceProxy : public IProxyBroker { +public: + explicit FaceAuthInterfaceProxy(const sptr& remote) : IProxyBroker(remote) {} + + virtual ~FaceAuthInterfaceProxy() = default; + + int32_t GetExecutorListV1_1(std::vector>& executorList) override; + + int32_t GetExecutorList(std::vector>& executorList) override; + + int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) override; + + static int32_t GetExecutorListV1_1_(std::vector>& executorList, + const sptr remote); + +private: + static inline BrokerDelegator delegator_; +}; + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACEPROXY_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_service.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_service.cpp new file mode 100755 index 0000000000000000000000000000000000000000..f701bd9352da2f6254d3dcd0ecb025a8cfe26732 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_service.cpp @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include "v1_1/face_auth_interface_service.h" +#include + +#define HDF_LOG_TAG face_auth_interface_service + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +extern "C" IFaceAuthInterface *FaceAuthInterfaceImplGetInstance(void) +{ + return new (std::nothrow) FaceAuthInterfaceService(); +} + +int32_t FaceAuthInterfaceService::GetExecutorListV1_1(std::vector>& executorList) +{ + return HDF_SUCCESS; +} + +int32_t FaceAuthInterfaceService::GetExecutorList(std::vector>& executorList) +{ + return HDF_SUCCESS; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_service.h b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_service.h new file mode 100755 index 0000000000000000000000000000000000000000..a9f46ef41c6cb3f789866bc24b498204200bd989 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_service.h @@ -0,0 +1,40 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACESERVICE_H +#define OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACESERVICE_H + +#include "v1_1/iface_auth_interface.h" + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +class FaceAuthInterfaceService : public OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface { +public: + FaceAuthInterfaceService() = default; + virtual ~FaceAuthInterfaceService() = default; + + int32_t GetExecutorListV1_1(std::vector>& executorList) override; + + int32_t GetExecutorList(std::vector>& executorList) override; + +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACESERVICE_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_stub.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_stub.cpp new file mode 100755 index 0000000000000000000000000000000000000000..e38b618557b7c953fc2be2bd5a1fe5105331b700 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_stub.cpp @@ -0,0 +1,143 @@ +/* + * 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. + */ + +#include "v1_1/face_auth_interface_stub.h" +#include +#include +#include +#include +#include +#include + +#define HDF_LOG_TAG face_auth_interface_stub + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + + +sptr OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::Get(bool isStub) +{ + return OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::Get("face_auth_interface_service", isStub); +} + +sptr OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::Get(const std::string& serviceName, bool isStub) +{ + if (!isStub) { + return nullptr; + } + std::string desc = Str16ToStr8(OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::GetDescriptor()); + void *impl = LoadHdiImpl(desc.c_str(), serviceName == "face_auth_interface_service" ? "service" : serviceName.c_str()); + if (impl == nullptr) { + HDF_LOGE("failed to load hdi impl %{public}s", desc.c_str()); + return nullptr; + } + return reinterpret_cast(impl); +} + + +OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::FaceAuthInterfaceStub(const sptr &impl) + : IPCObjectStub(OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::GetDescriptor()), impl_(impl) +{ +} + +OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::~FaceAuthInterfaceStub() +{ + ObjectCollector::GetInstance().RemoveObject(impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) +{ + switch (code) { + case CMD_FACE_AUTH_INTERFACE_GET_VERSION: + return FaceAuthInterfaceStubGetVersion(data, reply, option); + case CMD_FACE_AUTH_INTERFACE_GET_EXECUTOR_LIST_V1_1: + return FaceAuthInterfaceStubGetExecutorListV1_1(data, reply, option); + case CMD_FACE_AUTH_INTERFACE_GET_EXECUTOR_LIST: + return FaceAuthInterfaceStubGetExecutorList(data, reply, option); + default: { + HDF_LOGE("%{public}s: cmd %{public}d is not supported", __func__, code); + return IPCObjectStub::OnRemoteRequest(code, data, reply, option); + } + } +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetExecutorListV1_1(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption) +{ + return OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetExecutorListV1_1_(faceAuthInterfaceData, faceAuthInterfaceReply, faceAuthInterfaceOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetExecutorList(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption) +{ + return OHOS::HDI::FaceAuth::V1_0::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetExecutorList_(faceAuthInterfaceData, faceAuthInterfaceReply, faceAuthInterfaceOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetVersion(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption) +{ + return OHOS::HDI::FaceAuth::V1_0::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetVersion_(faceAuthInterfaceData, faceAuthInterfaceReply, faceAuthInterfaceOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::FaceAuthInterfaceStub::FaceAuthInterfaceStubGetExecutorListV1_1_(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption, sptr impl) +{ + if (faceAuthInterfaceData.ReadInterfaceToken() != OHOS::HDI::FaceAuth::V1_1::IFaceAuthInterface::GetDescriptor()) { + HDF_LOGE("%{public}s: interface token check failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + bool faceAuthInterfaceMemSet = false; + if (!faceAuthInterfaceData.ReadBool(faceAuthInterfaceMemSet)) { + HDF_LOGE("%{public}s: failed to read faceAuthInterfaceMemSet", __func__); + return HDF_ERR_INVALID_PARAM; + } + std::vector> executorList; + if (faceAuthInterfaceMemSet) { + uint32_t capacity = 0; + if (!faceAuthInterfaceData.ReadUint32(capacity)) { + HDF_LOGE("%{public}s: failed to read capacity", __func__); + return HDF_ERR_INVALID_PARAM; + } + HDI_CHECK_VALUE_RETURN(capacity, >, HDI_BUFF_MAX_SIZE / sizeof(sptr), HDF_ERR_INVALID_PARAM); + executorList.reserve(capacity); + } + + int32_t faceAuthInterfaceRet = impl->GetExecutorListV1_1(executorList); + if (faceAuthInterfaceRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %d", __func__, faceAuthInterfaceRet); + return faceAuthInterfaceRet; + } + + if (!faceAuthInterfaceReply.WriteUint32(executorList.size())) { + HDF_LOGE("%{public}s: write executorList size failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + for (const auto& it0 : executorList) { + if (it0 == nullptr) { + HDF_LOGE("%{public}s: parameter it0 is nullptr!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!faceAuthInterfaceReply.WriteRemoteObject(OHOS::HDI::ObjectCollector::GetInstance().GetOrNewObject(it0, OHOS::HDI::FaceAuth::V1_1::IExecutor::GetDescriptor()))) { + HDF_LOGE("%{public}s: write it0 failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + } + + return faceAuthInterfaceRet; +} +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_stub.h b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_stub.h new file mode 100755 index 0000000000000000000000000000000000000000..343c72f74e365d55b4d94d89711d5463cf98e07e --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_interface_stub.h @@ -0,0 +1,58 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACESTUB_H +#define OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACESTUB_H + +#include +#include +#include +#include +#include +#include "v1_0/face_auth_interface_stub.h" +#include "v1_1/iface_auth_interface.h" + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +using namespace OHOS; +class FaceAuthInterfaceStub : public IPCObjectStub { +public: + explicit FaceAuthInterfaceStub(const sptr &impl); + virtual ~FaceAuthInterfaceStub(); + + int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; + + static int32_t FaceAuthInterfaceStubGetExecutorListV1_1_(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption, sptr impl); + +private: + int32_t FaceAuthInterfaceStubGetExecutorListV1_1(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption); + + int32_t FaceAuthInterfaceStubGetExecutorList(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption); + + int32_t FaceAuthInterfaceStubGetVersion(MessageParcel& faceAuthInterfaceData, MessageParcel& faceAuthInterfaceReply, MessageOption& faceAuthInterfaceOption); + + + static inline ObjectDelegator objDelegator_; + sptr impl_; +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHINTERFACESTUB_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_types.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_types.cpp new file mode 100755 index 0000000000000000000000000000000000000000..8ada047a01b867cfff58af0282588b80060b9769 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_types.cpp @@ -0,0 +1,135 @@ +/* + * 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. + */ + +#include "v1_1/face_auth_types.h" +#include +#include +#include + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + + + +bool PropertyBlockMarshalling(OHOS::MessageParcel& data, const Property& dataBlock) +{ + if (!data.WriteUint64(dataBlock.authSubType)) { + HDF_LOGE("%{public}s: write dataBlock.authSubType failed!", __func__); + return false; + } + + if (!data.WriteInt32(dataBlock.lockoutDuration)) { + HDF_LOGE("%{public}s: write dataBlock.lockoutDuration failed!", __func__); + return false; + } + + if (!data.WriteInt32(dataBlock.remainAttempts)) { + HDF_LOGE("%{public}s: write dataBlock.remainAttempts failed!", __func__); + return false; + } + + if (!data.WriteCString(dataBlock.enrollProgress.c_str())) { + HDF_LOGE("%{public}s: write dataBlock.enrollProgress failed!", __func__); + return false; + } + + if (!data.WriteCString(dataBlock.sensorInfo.c_str())) { + HDF_LOGE("%{public}s: write dataBlock.sensorInfo failed!", __func__); + return false; + } + return true; +} + +bool PropertyBlockUnmarshalling(OHOS::MessageParcel& data, Property& dataBlock) +{ + if (!data.ReadUint64(dataBlock.authSubType)) { + HDF_LOGE("%{public}s: read dataBlock.authSubType failed!", __func__); + return false; + } + + if (!data.ReadInt32(dataBlock.lockoutDuration)) { + HDF_LOGE("%{public}s: read dataBlock.lockoutDuration failed!", __func__); + return false; + } + + if (!data.ReadInt32(dataBlock.remainAttempts)) { + HDF_LOGE("%{public}s: read dataBlock.remainAttempts failed!", __func__); + return false; + } + + const char* enrollProgressCp = data.ReadCString(); + if (enrollProgressCp == nullptr) { + HDF_LOGE("%{public}s: read enrollProgressCp failed", __func__); + return false; + } + dataBlock.enrollProgress = enrollProgressCp; + + const char* sensorInfoCp = data.ReadCString(); + if (sensorInfoCp == nullptr) { + HDF_LOGE("%{public}s: read sensorInfoCp failed", __func__); + return false; + } + dataBlock.sensorInfo = sensorInfoCp; + return true; +} + +bool SaCommandParamNoneBlockMarshalling(OHOS::MessageParcel& data, const SaCommandParamNone& dataBlock) +{ + if (!data.WriteUnpadBuffer((const void*)&dataBlock, sizeof(SaCommandParamNone))) { + return false; + } + return true; +} + +bool SaCommandParamNoneBlockUnmarshalling(OHOS::MessageParcel& data, SaCommandParamNone& dataBlock) +{ + const SaCommandParamNone *dataBlockPtr = reinterpret_cast(data.ReadUnpadBuffer(sizeof(SaCommandParamNone))); + if (dataBlockPtr == NULL) { + return false; + } + + if (memcpy_s(&dataBlock, sizeof(SaCommandParamNone), dataBlockPtr, sizeof(SaCommandParamNone)) != EOK) { + return false; + } + return true; +} + +bool SaCommandBlockMarshalling(OHOS::MessageParcel& data, const SaCommand& dataBlock) +{ + if (!data.WriteUnpadBuffer((const void*)&dataBlock, sizeof(SaCommand))) { + return false; + } + return true; +} + +bool SaCommandBlockUnmarshalling(OHOS::MessageParcel& data, SaCommand& dataBlock) +{ + const SaCommand *dataBlockPtr = reinterpret_cast(data.ReadUnpadBuffer(sizeof(SaCommand))); + if (dataBlockPtr == NULL) { + return false; + } + + if (memcpy_s(&dataBlock, sizeof(SaCommand), dataBlockPtr, sizeof(SaCommand)) != EOK) { + return false; + } + return true; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_types.h b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_types.h new file mode 100755 index 0000000000000000000000000000000000000000..dc7fdc7de75cd4c97dce29586592046abb68f490 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/face_auth_types.h @@ -0,0 +1,105 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHTYPES_H +#define OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHTYPES_H + +#include +#include +#include + +#ifndef HDI_BUFF_MAX_SIZE +#define HDI_BUFF_MAX_SIZE (1024 * 200) +#endif + +#ifndef HDI_CHECK_VALUE_RETURN +#define HDI_CHECK_VALUE_RETURN(lv, compare, rv, ret) do { \ + if ((lv) compare (rv)) { \ + return ret; \ + } \ +} while (false) +#endif + +#ifndef HDI_CHECK_VALUE_RET_GOTO +#define HDI_CHECK_VALUE_RET_GOTO(lv, compare, rv, ret, value, table) do { \ + if ((lv) compare (rv)) { \ + ret = value; \ + goto table; \ + } \ +} while (false) +#endif + +namespace OHOS { +class MessageParcel; +} + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +using namespace OHOS; + +enum GetPropertyType : int32_t { + AUTH_SUB_TYPE = 1, + LOCKOUT_DURATION = 2, + REMAIN_ATTEMPTS = 3, + ENROLL_PROGRESS = 4, + SENSOR_INFO = 5, +}; + +struct Property { + uint64_t authSubType; + int32_t lockoutDuration; + int32_t remainAttempts; + std::string enrollProgress; + std::string sensorInfo; +}; + +enum SaCommandId : int32_t { + BEGIN_SCREEN_BRIGHTNESS_INCREASE = 1, + END_SCREEN_BRIGHTNESS_INCREASE = 2, +}; + +struct SaCommandParamNone { +} __attribute__ ((aligned(8))); + +union SaCommandParam { + SaCommandParamNone none; +} __attribute__ ((aligned(8))); + +struct SaCommand { + SaCommandId id; + SaCommandParam param; +} __attribute__ ((aligned(8))); + +bool PropertyBlockMarshalling(OHOS::MessageParcel &data, const Property& dataBlock); + +bool PropertyBlockUnmarshalling(OHOS::MessageParcel &data, Property& dataBlock); + +bool SaCommandParamNoneBlockMarshalling(OHOS::MessageParcel &data, const SaCommandParamNone& dataBlock); + +bool SaCommandParamNoneBlockUnmarshalling(OHOS::MessageParcel &data, SaCommandParamNone& dataBlock); + +bool SaCommandBlockMarshalling(OHOS::MessageParcel &data, const SaCommand& dataBlock); + +bool SaCommandBlockUnmarshalling(OHOS::MessageParcel &data, SaCommand& dataBlock); + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_FACEAUTHTYPES_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/iexecutor.h b/framework/tools/hdi-gen/out/face_auth/v1_1/iexecutor.h new file mode 100755 index 0000000000000000000000000000000000000000..d51e61d3e69a7a0cfb0c9d26651c3bbbd65d8cf8 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/iexecutor.h @@ -0,0 +1,96 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_IEXECUTOR_H +#define OHOS_HDI_FACE_AUTH_V1_1_IEXECUTOR_H + +#include +#include +#include +#include +#include "face_auth/v1_0/face_auth_types.h" +#include "face_auth/v1_0/iexecutor.h" +#include "face_auth/v1_1/face_auth_types.h" +#include "face_auth/v1_1/isa_command_callback.h" + +#ifndef HDI_BUFF_MAX_SIZE +#define HDI_BUFF_MAX_SIZE (1024 * 200) +#endif + +#ifndef HDI_CHECK_VALUE_RETURN +#define HDI_CHECK_VALUE_RETURN(lv, compare, rv, ret) do { \ + if ((lv) compare (rv)) { \ + return ret; \ + } \ +} while (false) +#endif + +#ifndef HDI_CHECK_VALUE_RET_GOTO +#define HDI_CHECK_VALUE_RET_GOTO(lv, compare, rv, ret, value, table) do { \ + if ((lv) compare (rv)) { \ + ret = value; \ + goto table; \ + } \ +} while (false) +#endif + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +using namespace OHOS; +using namespace OHOS::HDI; +using namespace OHOS::HDI::FaceAuth::V1_0; + +enum { + CMD_EXECUTOR_GET_PROPERTY = 11, + CMD_EXECUTOR_SET_CACHED_TEMPLATES = 12, + CMD_EXECUTOR_REGISTER_SA_COMMAND_CALLBACK = 13, +}; + +class IExecutor : public OHOS::HDI::FaceAuth::V1_0::IExecutor { +public: + DECLARE_HDI_DESCRIPTOR(u"ohos.hdi.face_auth.v1_1.IExecutor"); + + virtual ~IExecutor() = default; + + static sptr Get(bool isStub = false); + static sptr Get(const std::string &serviceName, bool isStub = false); + + virtual int32_t GetProperty(const std::vector& templateIdList, + const std::vector& propertyTypes, Property& property) = 0; + + virtual int32_t SetCachedTemplates(const std::vector& templateIdList) = 0; + + virtual int32_t RegisterSaCommandCallback(const sptr& callbackObj) = 0; + + int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) override + { + majorVer = 1; + minorVer = 1; + return HDF_SUCCESS; + } + + const std::u16string GetDesc() override + { + return metaDescriptor_; + } +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_IEXECUTOR_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/iface_auth_interface.h b/framework/tools/hdi-gen/out/face_auth/v1_1/iface_auth_interface.h new file mode 100755 index 0000000000000000000000000000000000000000..35a034ca821844009fc906cc6dca2855691eaebf --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/iface_auth_interface.h @@ -0,0 +1,87 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_IFACEAUTHINTERFACE_H +#define OHOS_HDI_FACE_AUTH_V1_1_IFACEAUTHINTERFACE_H + +#include +#include +#include +#include +#include "face_auth/v1_0/iface_auth_interface.h" +#include "face_auth/v1_1/iexecutor.h" + +#ifndef HDI_BUFF_MAX_SIZE +#define HDI_BUFF_MAX_SIZE (1024 * 200) +#endif + +#ifndef HDI_CHECK_VALUE_RETURN +#define HDI_CHECK_VALUE_RETURN(lv, compare, rv, ret) do { \ + if ((lv) compare (rv)) { \ + return ret; \ + } \ +} while (false) +#endif + +#ifndef HDI_CHECK_VALUE_RET_GOTO +#define HDI_CHECK_VALUE_RET_GOTO(lv, compare, rv, ret, value, table) do { \ + if ((lv) compare (rv)) { \ + ret = value; \ + goto table; \ + } \ +} while (false) +#endif + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +using namespace OHOS; +using namespace OHOS::HDI; +using namespace OHOS::HDI::FaceAuth::V1_0; + +enum { + CMD_FACE_AUTH_INTERFACE_GET_EXECUTOR_LIST_V1_1 = 2, +}; + +class IFaceAuthInterface : public OHOS::HDI::FaceAuth::V1_0::IFaceAuthInterface { +public: + DECLARE_HDI_DESCRIPTOR(u"ohos.hdi.face_auth.v1_1.IFaceAuthInterface"); + + virtual ~IFaceAuthInterface() = default; + + static sptr Get(bool isStub = false); + static sptr Get(const std::string &serviceName, bool isStub = false); + + virtual int32_t GetExecutorListV1_1(std::vector>& executorList) = 0; + + int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) override + { + majorVer = 1; + minorVer = 1; + return HDF_SUCCESS; + } + + const std::u16string GetDesc() override + { + return metaDescriptor_; + } +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_IFACEAUTHINTERFACE_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/isa_command_callback.h b/framework/tools/hdi-gen/out/face_auth/v1_1/isa_command_callback.h new file mode 100755 index 0000000000000000000000000000000000000000..9c0f7605b86c7547d2357a2bfe52b8aa5c94424e --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/isa_command_callback.h @@ -0,0 +1,83 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_ISACOMMANDCALLBACK_H +#define OHOS_HDI_FACE_AUTH_V1_1_ISACOMMANDCALLBACK_H + +#include +#include +#include +#include +#include "face_auth/v1_1/face_auth_types.h" + +#ifndef HDI_BUFF_MAX_SIZE +#define HDI_BUFF_MAX_SIZE (1024 * 200) +#endif + +#ifndef HDI_CHECK_VALUE_RETURN +#define HDI_CHECK_VALUE_RETURN(lv, compare, rv, ret) do { \ + if ((lv) compare (rv)) { \ + return ret; \ + } \ +} while (false) +#endif + +#ifndef HDI_CHECK_VALUE_RET_GOTO +#define HDI_CHECK_VALUE_RET_GOTO(lv, compare, rv, ret, value, table) do { \ + if ((lv) compare (rv)) { \ + ret = value; \ + goto table; \ + } \ +} while (false) +#endif + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +using namespace OHOS; +using namespace OHOS::HDI; + +enum { + CMD_SA_COMMAND_CALLBACK_GET_VERSION = 0, + CMD_SA_COMMAND_CALLBACK_ON_SA_COMMANDS = 1, +}; + +class ISaCommandCallback : public HdiBase { +public: + DECLARE_HDI_DESCRIPTOR(u"ohos.hdi.face_auth.v1_1.ISaCommandCallback"); + + virtual ~ISaCommandCallback() = default; + + virtual int32_t OnSaCommands(const std::vector& commands) = 0; + + virtual int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) + { + majorVer = 1; + minorVer = 1; + return HDF_SUCCESS; + } + + virtual const std::u16string GetDesc() + { + return metaDescriptor_; + } +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_ISACOMMANDCALLBACK_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_proxy.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_proxy.cpp new file mode 100755 index 0000000000000000000000000000000000000000..17e59b07049be7cb2aed0d61e7bc4bbfe520b8f0 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_proxy.cpp @@ -0,0 +1,121 @@ +/* + * 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. + */ + +#include "v1_1/sa_command_callback_proxy.h" +#include +#include +#include +#include +#include +#include + +#define HDF_LOG_TAG sa_command_callback_proxy + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +template +static bool WritePodArray(MessageParcel &parcel, const std::vector &data); + + +template +static bool WritePodArray(MessageParcel &parcel, const std::vector &data) +{ + if (!parcel.WriteUint32(data.size())) { + HDF_LOGE("%{public}s: failed to write data size", __func__); + return false; + } + if (data.empty()) { + return true; + } + if (!parcel.WriteUnpadBuffer((const void*)data.data(), sizeof(ElementType) * data.size())) { + HDF_LOGE("%{public}s: failed to write array", __func__); + return false; + } + return true; +} +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackProxy::OnSaCommands(const std::vector& commands) +{ + return OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackProxy::OnSaCommands_(commands, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackProxy::GetVersion(uint32_t& majorVer, uint32_t& minorVer) +{ + return OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackProxy::GetVersion_(majorVer, minorVer, Remote()); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackProxy::OnSaCommands_(const std::vector& commands, + const sptr remote) +{ + MessageParcel saCommandCallbackData; + MessageParcel saCommandCallbackReply; + MessageOption saCommandCallbackOption(MessageOption::TF_SYNC); + + if (!saCommandCallbackData.WriteInterfaceToken(OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback::GetDescriptor())) { + HDF_LOGE("%{public}s: failed to write interface descriptor!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!WritePodArray(saCommandCallbackData, commands)) { + HDF_LOGE("%{public}s: failed to write commands", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t saCommandCallbackRet = remote->SendRequest(CMD_SA_COMMAND_CALLBACK_ON_SA_COMMANDS, saCommandCallbackData, saCommandCallbackReply, saCommandCallbackOption); + if (saCommandCallbackRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %{public}d", __func__, saCommandCallbackRet); + return saCommandCallbackRet; + } + + return saCommandCallbackRet; +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackProxy::GetVersion_(uint32_t& majorVer, uint32_t& minorVer, + const sptr remote) +{ + MessageParcel saCommandCallbackData; + MessageParcel saCommandCallbackReply; + MessageOption saCommandCallbackOption(MessageOption::TF_SYNC); + + if (!saCommandCallbackData.WriteInterfaceToken(OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback::GetDescriptor())) { + HDF_LOGE("%{public}s: failed to write interface descriptor!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t saCommandCallbackRet = remote->SendRequest(CMD_SA_COMMAND_CALLBACK_GET_VERSION, saCommandCallbackData, saCommandCallbackReply, saCommandCallbackOption); + if (saCommandCallbackRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %{public}d", __func__, saCommandCallbackRet); + return saCommandCallbackRet; + } + + if (!saCommandCallbackReply.ReadUint32(majorVer)) { + HDF_LOGE("%{public}s: read majorVer failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!saCommandCallbackReply.ReadUint32(minorVer)) { + HDF_LOGE("%{public}s: read minorVer failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + return saCommandCallbackRet; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_proxy.h b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_proxy.h new file mode 100755 index 0000000000000000000000000000000000000000..364f16eba09ea15f9fa99b5ea1a12bcd5257e47f --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_proxy.h @@ -0,0 +1,50 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKPROXY_H +#define OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKPROXY_H + +#include "v1_1/isa_command_callback.h" +#include + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +class SaCommandCallbackProxy : public IProxyBroker { +public: + explicit SaCommandCallbackProxy(const sptr& remote) : IProxyBroker(remote) {} + + virtual ~SaCommandCallbackProxy() = default; + + int32_t OnSaCommands(const std::vector& commands) override; + + int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) override; + + static int32_t OnSaCommands_(const std::vector& commands, const sptr remote); + + static int32_t GetVersion_(uint32_t& majorVer, uint32_t& minorVer, const sptr remote); + +private: + static inline BrokerDelegator delegator_; +}; + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKPROXY_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_service.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_service.cpp new file mode 100755 index 0000000000000000000000000000000000000000..dd67e70f3f5de28f092820c2af847747e0c25c5a --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_service.cpp @@ -0,0 +1,33 @@ +/* + * 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. + */ + +#include "v1_1/sa_command_callback_service.h" +#include + +#define HDF_LOG_TAG sa_command_callback_service + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +int32_t SaCommandCallbackService::OnSaCommands(const std::vector& commands) +{ + return HDF_SUCCESS; +} + +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_service.h b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_service.h new file mode 100755 index 0000000000000000000000000000000000000000..bd4413c8d481b4cc208e2ee7c2e0432683d63dfb --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_service.h @@ -0,0 +1,38 @@ +/* + * 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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKSERVICE_H +#define OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKSERVICE_H + +#include "v1_1/isa_command_callback.h" + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +class SaCommandCallbackService : public OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback { +public: + SaCommandCallbackService() = default; + virtual ~SaCommandCallbackService() = default; + + int32_t OnSaCommands(const std::vector& commands) override; + +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKSERVICE_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_stub.cpp b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_stub.cpp new file mode 100755 index 0000000000000000000000000000000000000000..dcf20fa4fcdbbf3f4e6f8711bf11724720eb3db4 --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_stub.cpp @@ -0,0 +1,141 @@ +/* + * 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. + */ + +#include "v1_1/sa_command_callback_stub.h" +#include +#include + +#define HDF_LOG_TAG sa_command_callback_stub + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { +template +static bool ReadPodArray(MessageParcel &parcel, std::vector &data); + + +template +static bool ReadPodArray(MessageParcel &parcel, std::vector &data) +{ + data.clear(); + uint32_t size = 0; + if (!parcel.ReadUint32(size)) { + HDF_LOGE("%{public}s: failed to read size", __func__); + return false; + } + + if (size == 0) { + return true; + } + const ElementType *dataPtr = reinterpret_cast(parcel.ReadUnpadBuffer(sizeof(ElementType) * size)); + if (dataPtr == nullptr) { + HDF_LOGI("%{public}s: failed to read data", __func__); + return false; + } + data.assign(dataPtr, dataPtr + size); + return true; +} + + +OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStub(const sptr &impl) + : IPCObjectStub(OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback::GetDescriptor()), impl_(impl) +{ +} + +OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::~SaCommandCallbackStub() +{ + ObjectCollector::GetInstance().RemoveObject(impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) +{ + switch (code) { + case CMD_SA_COMMAND_CALLBACK_GET_VERSION: + return SaCommandCallbackStubGetVersion(data, reply, option); + case CMD_SA_COMMAND_CALLBACK_ON_SA_COMMANDS: + return SaCommandCallbackStubOnSaCommands(data, reply, option); + default: { + HDF_LOGE("%{public}s: cmd %{public}d is not supported", __func__, code); + return IPCObjectStub::OnRemoteRequest(code, data, reply, option); + } + } +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStubOnSaCommands(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption) +{ + return OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStubOnSaCommands_(saCommandCallbackData, saCommandCallbackReply, saCommandCallbackOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStubGetVersion(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption) +{ + return OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStubGetVersion_(saCommandCallbackData, saCommandCallbackReply, saCommandCallbackOption, impl_); +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStubOnSaCommands_(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption, sptr impl) +{ + if (saCommandCallbackData.ReadInterfaceToken() != OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback::GetDescriptor()) { + HDF_LOGE("%{public}s: interface token check failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + std::vector commands; + if (!ReadPodArray(saCommandCallbackData, commands)) { + HDF_LOGE("%{public}s: failed to read commands", __func__); + return HDF_ERR_INVALID_PARAM; + } + + int32_t saCommandCallbackRet = impl->OnSaCommands(commands); + if (saCommandCallbackRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %d", __func__, saCommandCallbackRet); + return saCommandCallbackRet; + } + + return saCommandCallbackRet; +} + +int32_t OHOS::HDI::FaceAuth::V1_1::SaCommandCallbackStub::SaCommandCallbackStubGetVersion_(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption, sptr impl) +{ + if (saCommandCallbackData.ReadInterfaceToken() != OHOS::HDI::FaceAuth::V1_1::ISaCommandCallback::GetDescriptor()) { + HDF_LOGE("%{public}s: interface token check failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + uint32_t majorVer = 0; + + uint32_t minorVer = 0; + + int32_t saCommandCallbackRet = impl->GetVersion(majorVer, minorVer); + if (saCommandCallbackRet != HDF_SUCCESS) { + HDF_LOGE("%{public}s failed, error code is %d", __func__, saCommandCallbackRet); + return saCommandCallbackRet; + } + + if (!saCommandCallbackReply.WriteUint32(majorVer)) { + HDF_LOGE("%{public}s: write majorVer failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + if (!saCommandCallbackReply.WriteUint32(minorVer)) { + HDF_LOGE("%{public}s: write minorVer failed!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + return saCommandCallbackRet; +} +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS diff --git a/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_stub.h b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_stub.h new file mode 100755 index 0000000000000000000000000000000000000000..56cc5d95de2ecb4a1b2c9633147aad21978aef7e --- /dev/null +++ b/framework/tools/hdi-gen/out/face_auth/v1_1/sa_command_callback_stub.h @@ -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. + */ + +#ifndef OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKSTUB_H +#define OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKSTUB_H + +#include +#include +#include +#include +#include +#include "v1_1/isa_command_callback.h" + +namespace OHOS { +namespace HDI { +namespace FaceAuth { +namespace V1_1 { + +using namespace OHOS; +class SaCommandCallbackStub : public IPCObjectStub { +public: + explicit SaCommandCallbackStub(const sptr &impl); + virtual ~SaCommandCallbackStub(); + + int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; + + static int32_t SaCommandCallbackStubOnSaCommands_(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption, sptr impl); + + static int32_t SaCommandCallbackStubGetVersion_(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption, sptr impl); + +private: + int32_t SaCommandCallbackStubOnSaCommands(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption); + + int32_t SaCommandCallbackStubGetVersion(MessageParcel& saCommandCallbackData, MessageParcel& saCommandCallbackReply, MessageOption& saCommandCallbackOption); + + + static inline ObjectDelegator objDelegator_; + sptr impl_; +}; +} // V1_1 +} // FaceAuth +} // HDI +} // OHOS + +#endif // OHOS_HDI_FACE_AUTH_V1_1_SACOMMANDCALLBACKSTUB_H \ No newline at end of file diff --git a/framework/tools/hdi-gen/parser/parser.cpp b/framework/tools/hdi-gen/parser/parser.cpp old mode 100644 new mode 100755 index 6e0b790d5d3df14cfff0f75a44c442b16f22a326..bf122be180c4fd237f1432105f006007384af369 --- a/framework/tools/hdi-gen/parser/parser.cpp +++ b/framework/tools/hdi-gen/parser/parser.cpp @@ -179,6 +179,7 @@ bool Parser::ParserPackageInfo(const std::string &packageName) size_t majorVersion = std::stoul(result.str(RE_PACKAGE_MAJOR_VER_INDEX)); size_t minorVersion = std::stoul(result.str(RE_PACKAGE_MINOR_VER_INDEX)); ast_->SetVersion(majorVersion, minorVersion); + return true; } @@ -794,6 +795,7 @@ AutoPtr Parser::ParseType() while (lexer_.PeekToken().kind == TokenType::BRACKETS_LEFT) { type = ParseArrayType(type); } + return type; } @@ -851,11 +853,12 @@ AutoPtr Parser::ParseArrayType(const AutoPtr &elementType) AutoPtr arrayType = new ASTArrayType(); arrayType->SetElementType(elementType); - AutoPtr retType = ast_->FindType(arrayType->ToString()); - if (retType == nullptr) { - retType = arrayType.Get(); - } + // AutoPtr retType = ast_->FindType(arrayType->ToString()); + // if (retType == nullptr) { + // retType = arrayType.Get(); + // } + AutoPtr retType = arrayType.Get(); ast_->AddType(retType); return retType; } @@ -886,12 +889,14 @@ AutoPtr Parser::ParseListType() AutoPtr listType = new ASTListType(); listType->SetElementType(type); - AutoPtr retType = ast_->FindType(listType->ToString()); - if (retType == nullptr) { - retType = listType.Get(); - } + // AutoPtr retType = ast_->FindType(listType->ToString()); + // if (retType == nullptr) { + // retType = listType.Get(); + // } + AutoPtr retType = listType.Get(); ast_->AddType(retType); + return retType; } @@ -937,11 +942,12 @@ AutoPtr Parser::ParseMapType() AutoPtr mapType = new ASTMapType(); mapType->SetKeyType(keyType); mapType->SetValueType(valueType); - AutoPtr retType = ast_->FindType(mapType->ToString()); - if (retType == nullptr) { - retType = mapType.Get(); - } + // AutoPtr retType = ast_->FindType(mapType->ToString()); + // if (retType == nullptr) { + // retType = mapType.Get(); + // } + AutoPtr retType = mapType.Get(); ast_->AddType(retType); return retType; } @@ -972,11 +978,11 @@ AutoPtr Parser::ParseSmqType() AutoPtr smqType = new ASTSmqType(); smqType->SetInnerType(innerType); - AutoPtr retType = ast_->FindType(smqType->ToString()); - if (retType == nullptr) { - retType = smqType.Get(); - } - + // AutoPtr retType = ast_->FindType(smqType->ToString()); + // if (retType == nullptr) { + // retType = smqType.Get(); + // } + AutoPtr retType = smqType.Get(); ast_->AddType(retType); return retType; } @@ -988,7 +994,7 @@ AutoPtr Parser::ParseUserDefType() return ast_->FindType(token.value); } - std::string typePrefix = token.value; + // std::string typePrefix = token.value; token = lexer_.PeekToken(); if (token.kind != TokenType::ID) { @@ -998,7 +1004,8 @@ AutoPtr Parser::ParseUserDefType() lexer_.GetToken(); } - std::string typeName = typePrefix + " " + token.value; + // std::string typeName = typePrefix + " " + token.value; + std::string typeName = token.value; AutoPtr type = ast_->FindType(typeName); ast_->AddType(type); return type; @@ -1008,7 +1015,6 @@ void Parser::ParseEnumDeclaration(const AttrSet &attrs) { AutoPtr enumType = new ASTEnumType; enumType->SetAttribute(ParseUserDefTypeAttr(attrs)); - lexer_.GetToken(); Token token = lexer_.PeekToken(); if (token.kind != TokenType::ID) { diff --git a/framework/tools/hdi-gen/parser/parser.h b/framework/tools/hdi-gen/parser/parser.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/preprocessor/preprocessor.cpp b/framework/tools/hdi-gen/preprocessor/preprocessor.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/preprocessor/preprocessor.h b/framework/tools/hdi-gen/preprocessor/preprocessor.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/bad_02/foo/v1_0/IFoo.idl b/framework/tools/hdi-gen/test/hash_test/bad_02/foo/v1_0/IFoo.idl old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/bad_03/foo/v1_0/IFoo.idl b/framework/tools/hdi-gen/test/hash_test/bad_03/foo/v1_0/IFoo.idl old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/bad_04/IFoo.idl b/framework/tools/hdi-gen/test/hash_test/bad_04/IFoo.idl old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/good/foo/v1_0/IFoo.idl b/framework/tools/hdi-gen/test/hash_test/good/foo/v1_0/IFoo.idl old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/good/foo/v1_0/IFooCallback.idl b/framework/tools/hdi-gen/test/hash_test/good/foo/v1_0/IFooCallback.idl old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/good/foo/v1_0/Types.idl b/framework/tools/hdi-gen/test/hash_test/good/foo/v1_0/Types.idl old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/good/hash.txt b/framework/tools/hdi-gen/test/hash_test/good/hash.txt old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/test/hash_test/hash_test.py b/framework/tools/hdi-gen/test/hash_test/hash_test.py old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/autoptr.h b/framework/tools/hdi-gen/util/autoptr.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/common.h b/framework/tools/hdi-gen/util/common.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/file.cpp b/framework/tools/hdi-gen/util/file.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/file.h b/framework/tools/hdi-gen/util/file.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/light_refcount_base.cpp b/framework/tools/hdi-gen/util/light_refcount_base.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/light_refcount_base.h b/framework/tools/hdi-gen/util/light_refcount_base.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/logger.cpp b/framework/tools/hdi-gen/util/logger.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/logger.h b/framework/tools/hdi-gen/util/logger.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/options.cpp b/framework/tools/hdi-gen/util/options.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/options.h b/framework/tools/hdi-gen/util/options.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/string_builder.cpp b/framework/tools/hdi-gen/util/string_builder.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/string_builder.h b/framework/tools/hdi-gen/util/string_builder.h old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/string_helper.cpp b/framework/tools/hdi-gen/util/string_helper.cpp old mode 100644 new mode 100755 diff --git a/framework/tools/hdi-gen/util/string_helper.h b/framework/tools/hdi-gen/util/string_helper.h old mode 100644 new mode 100755