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 OHOS_DM_HICHAIN_CONNECTOR_CALLBACK_H 17 #define OHOS_DM_HICHAIN_CONNECTOR_CALLBACK_H 18 19 namespace OHOS { 20 namespace DistributedHardware { 21 class IHiChainConnectorCallback { 22 public: 23 virtual void OnGroupCreated(int64_t requestId, const std::string &groupId) = 0; 24 virtual void OnMemberJoin(int64_t requestId, int32_t status) = 0; 25 virtual std::string GetConnectAddr(std::string deviceId) = 0; 26 virtual int32_t GetPinCode(int32_t &code) = 0; 27 }; 28 29 class IDmGroupResCallback { 30 public: 31 virtual void OnGroupResult(int64_t requestId, int32_t action, const std::string &resultInfo) = 0; 32 }; 33 34 class IDmDeviceAuthCallback { 35 public: 36 virtual bool AuthDeviceTransmit(int64_t requestId, const uint8_t *data, uint32_t dataLen) = 0; 37 virtual void AuthDeviceFinish(int64_t requestId) = 0; 38 virtual void AuthDeviceError(int64_t requestId, int32_t errorCode) = 0; 39 virtual void AuthDeviceSessionKey(int64_t requestId, const uint8_t *sessionKey, uint32_t sessionKeyLen) = 0; 40 virtual int32_t GetPinCode(int32_t &code) = 0; 41 virtual void GetRemoteDeviceId(std::string &deviceId) = 0; 42 }; 43 } // namespace DistributedHardware 44 } // namespace OHOS 45 #endif // OHOS_DM_HICHAIN_CONNECTOR_CALLBACK_H 46