1 /*
2  * Copyright (c) 2023 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 LNN_BLE_LPDEVICE_H
17 #define LNN_BLE_LPDEVICE_H
18 
19 #include <stdint.h>
20 #include "lnn_node_info.h"
21 #include "softbus_broadcast_type.h"
22 #include "softbus_common.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 typedef enum {
29     SOFTBUS_SUPPORT_HEARTBEAT_TYPE = 0,
30     SOFTBUS_SUPPORT_BURST_TYPE,
31     SOFTBUS_SUPPORT_ALL_TYPE,
32 } LpFeatureType;
33 
34 typedef struct {
35     bool isOnline;
36     char udid[UDID_BUF_LEN];
37 } LpDeviceStateInfo;
38 
39 int32_t LnnRegisterBleLpDeviceMediumMgr(void);
40 void SendDeviceStateToMlps(void *para);
41 void UpdateLocalDeviceInfoToMlps(const NodeInfo *localInfo);
42 void UpdateRemoteDeviceInfoToMlps(const NodeInfo *info);
43 void UpdateRemoteDeviceInfoListToMlps(void);
44 int32_t GetBurstAdvId(void);
45 int32_t SendDeviceInfoToSHByType(LpFeatureType type);
46 int32_t SendAdvInfoToMlps(LpBroadcastParam *lpAdvParam, LpServerType type);
47 int32_t SwtichHeartbeatReportChannel(bool isToAP, uint16_t scanInterval, uint16_t scanWindow);
48 bool IsSupportLpFeature(void);
49 void SetLpKeepAliveState(void *para);
50 void AsyncSetBleBroadcastTimeStamp(const char *networkId);
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif /*LNN_BLE_LPDEVICE_H*/
56