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 SEC_MESSENGER_DEVICE_STATUS_MANAGER_H
17 #define SEC_MESSENGER_DEVICE_STATUS_MANAGER_H
18 
19 #ifdef __cplusplus
20 #include <cstdbool>
21 #include <cstdint>
22 #else
23 #include <stdbool.h>
24 #include <stdint.h>
25 #endif
26 
27 #include "messenger.h"
28 #include "utils_work_queue.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 bool InitDeviceStatusManager(WorkQueue *queue, const char *pkgName, DeviceStatusReceiver deviceStatusReceiver);
35 
36 bool DeInitDeviceStatusManager(void);
37 
38 bool MessengerGetDeviceOnlineStatus(const DeviceIdentify *devId, int32_t *level);
39 
40 bool MessengerGetSelfDeviceIdentify(DeviceIdentify *devId, int32_t *level);
41 
42 void MessengerForEachDeviceProcess(const DeviceProcessor processor, void *para);
43 
44 bool MessengerGetNetworkIdByDeviceIdentify(const DeviceIdentify *devId, char *networkId, uint32_t len);
45 
46 bool MessengerGetDeviceIdentifyByNetworkId(const char *networkId, DeviceIdentify *devId);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif // SEC_MESSENGER_DEVICE_STATUS_MANAGER_H
53