12ee81decSopenharmony_ci/* 22ee81decSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 32ee81decSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 42ee81decSopenharmony_ci * you may not use this file except in compliance with the License. 52ee81decSopenharmony_ci * You may obtain a copy of the License at 62ee81decSopenharmony_ci * 72ee81decSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 82ee81decSopenharmony_ci * 92ee81decSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 102ee81decSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 112ee81decSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 122ee81decSopenharmony_ci * See the License for the specific language governing permissions and 132ee81decSopenharmony_ci * limitations under the License. 142ee81decSopenharmony_ci */ 152ee81decSopenharmony_ci 162ee81decSopenharmony_ci#include "messenger.h" 172ee81decSopenharmony_ci#include "messenger_impl.h" 182ee81decSopenharmony_ci 192ee81decSopenharmony_ciMessenger *CreateMessenger(const MessengerConfig *config) 202ee81decSopenharmony_ci{ 212ee81decSopenharmony_ci return CreateMessengerImpl(config); 222ee81decSopenharmony_ci} 232ee81decSopenharmony_ci 242ee81decSopenharmony_civoid DestroyMessenger(Messenger *messenger) 252ee81decSopenharmony_ci{ 262ee81decSopenharmony_ci DestroyMessengerImpl(messenger); 272ee81decSopenharmony_ci} 282ee81decSopenharmony_ci 292ee81decSopenharmony_cibool IsMessengerReady(const Messenger *messenger) 302ee81decSopenharmony_ci{ 312ee81decSopenharmony_ci return IsMessengerReadyImpl(messenger); 322ee81decSopenharmony_ci} 332ee81decSopenharmony_ci 342ee81decSopenharmony_civoid SendMsgTo(const Messenger *messenger, uint64_t transNo, const DeviceIdentify *devId, const uint8_t *msg, 352ee81decSopenharmony_ci uint32_t msgLen) 362ee81decSopenharmony_ci{ 372ee81decSopenharmony_ci SendMsgToImpl(messenger, transNo, devId, msg, msgLen); 382ee81decSopenharmony_ci} 392ee81decSopenharmony_ci 402ee81decSopenharmony_cibool GetDeviceOnlineStatus(const Messenger *messenger, const DeviceIdentify *devId, int32_t *level) 412ee81decSopenharmony_ci{ 422ee81decSopenharmony_ci return GetDeviceOnlineStatusImpl(messenger, devId, level); 432ee81decSopenharmony_ci} 442ee81decSopenharmony_ci 452ee81decSopenharmony_cibool GetSelfDeviceIdentify(const Messenger *messenger, DeviceIdentify *devId, int32_t *level) 462ee81decSopenharmony_ci{ 472ee81decSopenharmony_ci return GetSelfDeviceIdentifyImpl(messenger, devId, level); 482ee81decSopenharmony_ci} 492ee81decSopenharmony_ci 502ee81decSopenharmony_civoid ForEachDeviceProcess(const Messenger *messenger, const DeviceProcessor processor, void *para) 512ee81decSopenharmony_ci{ 522ee81decSopenharmony_ci ForEachDeviceProcessImpl(messenger, processor, para); 532ee81decSopenharmony_ci} 542ee81decSopenharmony_ci 552ee81decSopenharmony_cibool GetDeviceStatisticInfo(const Messenger *messenger, const DeviceIdentify *devId, StatisticInformation *info) 562ee81decSopenharmony_ci{ 572ee81decSopenharmony_ci return GetDeviceStatisticInfoImpl(messenger, devId, info); 582ee81decSopenharmony_ci}