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