• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_DISTRIBUTED_DATA_ADAPTER_COMMUNICATOR_COMMU_TYPES_H
17 #define OHOS_DISTRIBUTED_DATA_ADAPTER_COMMUNICATOR_COMMU_TYPES_H
18 #include <string>
19 #include "store_errno.h"
20 #include "visibility.h"
21 namespace OHOS::AppDistributedKv {
22 using Status = DistributedKv::Status;
23 struct API_EXPORT DeviceInfo {
24     std::string uuid;
25     std::string udid;
26     std::string networkId;
27     std::string deviceName;
28     uint32_t deviceType;
29     int32_t osType;
30     int32_t authForm;
31 };
32 
33 struct API_EXPORT AccessCaller {
34     std::string accountId;
35     std::string bundleName;
36     std::string networkId;
37     int32_t userId;
38 };
39 
40 struct API_EXPORT AccessCallee {
41     std::string accountId;
42     std::string networkId;
43     int32_t userId;
44 };
45 
46 struct API_EXPORT AclParams {
47     AccessCaller accCaller;
48     AccessCallee accCallee;
49     int32_t authType = 0;
50 };
51 
52 enum RouteType : int32_t {
53     INVALID_ROUTE_TYPE = -1,
54     ROUTE_TYPE_ALL = 0,
55     WIFI_STA,
56     WIFI_P2P,
57     BT_BR,
58     BT_BLE,
59     BUTT,
60 };
61 
62 struct DataInfo {
63     uint8_t *data;
64     uint32_t length;
65 };
66 
67 struct API_EXPORT PipeInfo {
68     std::string pipeId;
69     std::string userId;
70 };
71 
72 struct API_EXPORT DeviceId {
73     std::string deviceId;
74 };
75 
76 enum class API_EXPORT MessageType {
77     DEFAULT = 0,
78     FILE = 1,
79 };
80 
81 struct API_EXPORT MessageInfo {
82     MessageType msgType;
83 };
84 
85 enum class API_EXPORT DeviceChangeType {
86     DEVICE_OFFLINE = 0,
87     DEVICE_ONLINE = 1,
88     DEVICE_ONREADY = 2,
89 };
90 
91 enum class API_EXPORT DeviceStatus {
92     OFFLINE = 0,
93     ONLINE = 1,
94 };
95 
96 struct API_EXPORT LevelInfo {
97     uint16_t dynamic;
98     uint16_t statics;
99     uint32_t switches;
100     uint16_t switchesLen;
101 };
102 }
103 #endif // OHOS_DISTRIBUTED_DATA_ADAPTER_COMMUNICATOR_COMMU_TYPES_H
104