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 enum RouteType : int32_t { 34 INVALID_ROUTE_TYPE = -1, 35 ROUTE_TYPE_ALL = 0, 36 WIFI_STA, 37 WIFI_P2P, 38 BT_BR, 39 BT_BLE, 40 BUTT, 41 }; 42 43 struct DataInfo { 44 uint8_t *data; 45 uint32_t length; 46 }; 47 48 struct API_EXPORT PipeInfo { 49 std::string pipeId; 50 std::string userId; 51 }; 52 53 struct API_EXPORT DeviceId { 54 std::string deviceId; 55 }; 56 57 enum class API_EXPORT MessageType { 58 DEFAULT = 0, 59 FILE = 1, 60 }; 61 62 struct API_EXPORT MessageInfo { 63 MessageType msgType; 64 }; 65 66 enum class API_EXPORT DeviceChangeType { 67 DEVICE_OFFLINE = 0, 68 DEVICE_ONLINE = 1, 69 DEVICE_ONREADY = 2, 70 }; 71 72 enum class API_EXPORT DeviceStatus { 73 OFFLINE = 0, 74 ONLINE = 1, 75 }; 76 77 struct API_EXPORT LevelInfo { 78 uint16_t dynamic; 79 uint16_t statics; 80 uint32_t switches; 81 uint16_t switchesLen; 82 }; 83 } 84 #endif // OHOS_DISTRIBUTED_DATA_ADAPTER_COMMUNICATOR_COMMU_TYPES_H 85