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#include "messenger.h" 17#include "messenger_impl.h" 18 19Messenger *CreateMessenger(const MessengerConfig *config) 20{ 21 return CreateMessengerImpl(config); 22} 23 24void DestroyMessenger(Messenger *messenger) 25{ 26 DestroyMessengerImpl(messenger); 27} 28 29bool IsMessengerReady(const Messenger *messenger) 30{ 31 return IsMessengerReadyImpl(messenger); 32} 33 34void SendMsgTo(const Messenger *messenger, uint64_t transNo, const DeviceIdentify *devId, const uint8_t *msg, 35 uint32_t msgLen) 36{ 37 SendMsgToImpl(messenger, transNo, devId, msg, msgLen); 38} 39 40bool GetDeviceOnlineStatus(const Messenger *messenger, const DeviceIdentify *devId, int32_t *level) 41{ 42 return GetDeviceOnlineStatusImpl(messenger, devId, level); 43} 44 45bool GetSelfDeviceIdentify(const Messenger *messenger, DeviceIdentify *devId, int32_t *level) 46{ 47 return GetSelfDeviceIdentifyImpl(messenger, devId, level); 48} 49 50void ForEachDeviceProcess(const Messenger *messenger, const DeviceProcessor processor, void *para) 51{ 52 ForEachDeviceProcessImpl(messenger, processor, para); 53} 54 55bool GetDeviceStatisticInfo(const Messenger *messenger, const DeviceIdentify *devId, StatisticInformation *info) 56{ 57 return GetDeviceStatisticInfoImpl(messenger, devId, info); 58}