1 /* 2 * Copyright (C) 2021 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 CALLBACK_MANAGER_H 17 #define CALLBACK_MANAGER_H 18 19 #include "device_auth.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 bool ProcessTransmitCallback(int64_t reqId, const uint8_t *data, uint32_t dataLen, const DeviceAuthCallback *callback); 26 char *ProcessRequestCallback(int64_t reqId, int operationCode, const char *reqParams, 27 const DeviceAuthCallback *callback); 28 void ProcessFinishCallback(int64_t reqId, int operationCode, const char *returnData, 29 const DeviceAuthCallback *callback); 30 void ProcessSessionKeyCallback(int64_t reqId, const uint8_t *sessionKey, uint32_t sessionKeyLen, 31 const DeviceAuthCallback *callback); 32 void ProcessErrorCallback(int64_t reqId, int operationCode, int errorCode, const char *errorReturn, 33 const DeviceAuthCallback *callback); 34 35 int32_t InitCallbackManager(void); 36 void DestroyCallbackManager(void); 37 int32_t RegGroupManagerCallback(const char *appId, const DeviceAuthCallback *callback); 38 int32_t UnRegGroupManagerCallback(const char *appId); 39 const DeviceAuthCallback *GetGMCallbackByAppId(const char *appId); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 #endif 45