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 CHANNEL_MANAGER_H 17 #define CHANNEL_MANAGER_H 18 19 #include "device_auth.h" 20 #include "common_defs.h" 21 #include "json_utils.h" 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 int32_t InitChannelManager(void); 28 void DestroyChannelManager(void); 29 30 /* Channel operation interfaces */ 31 ChannelType GetChannelType(const DeviceAuthCallback *callback, const CJson *jsonParams); 32 int32_t OpenChannel(ChannelType channelType, const CJson *jsonParams, int64_t requestId, int64_t *returnChannelId); 33 void CloseChannel(ChannelType channelType, int64_t channelId); 34 int32_t HcSendMsg(ChannelType channelType, int64_t requestId, int64_t channelId, 35 const DeviceAuthCallback *callback, const char *data); 36 void NotifyBindResult(ChannelType channelType, int64_t channelId); 37 int32_t GetLocalConnectInfo(char *jsonAddrInfo, int32_t bufLen); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 #endif 43