• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 2025 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_DATA_CLOUD_SYNC_STRUCT_H
17 #define LNN_DATA_CLOUD_SYNC_STRUCT_H
18 
19 #include <stdint.h>
20 #include <stdbool.h>
21 
22 #include "bus_center_info_key_struct.h"
23 #include "lnn_node_info_struct.h"
24 #include "softbus_adapter_crypto.h"
25 #include "softbus_adapter_timer.h"
26 #include "softbus_common.h"
27 #include "softbus_bus_center.h"
28 #include "softbus_def.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #define CLOUD_SYNC_INFO_SIZE 33
35 
36 typedef struct {
37     char networkId[NETWORK_ID_BUF_LEN];
38     char deviceName[DEVICE_NAME_BUF_LEN];
39     char unifiedName[DEVICE_NAME_BUF_LEN];
40     char unifiedDefaultName[DEVICE_NAME_BUF_LEN];
41     char nickName[DEVICE_NAME_BUF_LEN];
42     char deviceUdid[UDID_BUF_LEN];
43     char uuid[UUID_BUF_LEN];
44     char softBusVersion[VERSION_MAX_LEN];
45     char pkgVersion[VERSION_MAX_LEN];
46     char macAddr[MAC_LEN];
47     unsigned char cipherKey[SESSION_KEY_LENGTH];
48     unsigned char cipherIv[BROADCAST_IV_LEN];
49     unsigned char publicAddress[LFINDER_MAC_ADDR_LEN];
50     char remotePtk[PTK_DEFAULT_LEN];
51     char osVersion[OS_VERSION_BUF_LEN];
52     bool isBleP2p;
53     bool distributedSwitch;
54     uint16_t deviceTypeId;
55     uint32_t authCapacity;
56     uint32_t heartbeatCapacity;
57     int32_t osType;
58     int32_t stateVersion;
59     char *broadcastCipherKey;
60     uint64_t supportedProtocols;
61     int64_t wifiVersion;
62     int64_t bleVersion;
63     int64_t accountId;
64     uint64_t feature;
65     uint64_t connSubFeature;
66     uint64_t timestamp;
67 } CloudSyncInfo;
68 
69 typedef enum {
70     DB_ADD = 0,
71     DB_UPDATE = 1,
72     DB_DELETE = 2,
73     DB_CHANGE_TYPE_MAX,
74 } ChangeType;
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif // LNN_DATA_CLOUD_SYNC_STRUCT_H
81