1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SECURITY_GUARD_SG_CLASSIFY_CLIENT_H 17 #define SECURITY_GUARD_SG_CLASSIFY_CLIENT_H 18 19 #include "security_guard_api.h" 20 21 #ifdef __cplusplus 22 #include <string> 23 namespace OHOS::Security::SecurityGuard { 24 using SecurityModelResult = struct { 25 std::string devId; 26 uint32_t modelId; 27 std::string param; 28 std::string result; 29 }; 30 31 using SecurityGuardRiskCallback = std::function<void(const SecurityModelResult &result)>; 32 33 int32_t RequestSecurityModelResultSync(const std::string &devId, uint32_t modelId, 34 const std::string ¶m, SecurityModelResult &result); 35 36 int32_t RequestSecurityModelResultAsync(const std::string &devId, uint32_t modelId, 37 const std::string ¶m, SecurityGuardRiskCallback callback); 38 } 39 40 #endif 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 int32_t RequestSecurityModelResultSync(const DeviceIdentify *devId, uint32_t modelId, SecurityModelResult *result); 47 48 int32_t RequestSecurityModelResultAsync(const DeviceIdentify *devId, uint32_t modelId, 49 SecurityGuardRiskCallback callback); 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif // SECURITY_GUARD_SG_CLASSIFY_CLIENT_H 56