1 /* 2 * Copyright (c) 2021-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 OHOS_DISTRIBUTED_DMS_DEVICE_INFO_H 17 #define OHOS_DISTRIBUTED_DMS_DEVICE_INFO_H 18 19 #include <iosfwd> 20 #include <string> 21 22 #include "parcel.h" 23 24 namespace OHOS { 25 namespace DistributedSchedule { 26 enum { 27 UNKNOWN_TYPE = 0x00, 28 }; 29 30 enum { 31 UNKNOWN_STATE = 0, 32 ONLINE = 1, 33 OFFLINE = 2, 34 }; 35 36 class DmsDeviceInfo : public Parcelable { 37 public: 38 DmsDeviceInfo(const std::string& deviceName, int32_t deviceType, 39 const std::string& networkId, int32_t deviceState = ONLINE) 40 : deviceName_(deviceName), deviceType_(deviceType), networkId_(networkId), deviceState_(deviceState) {} 41 ~DmsDeviceInfo() = default; 42 43 const std::string& GetDeviceName() const; 44 const std::string& GetNetworkId() const; 45 int32_t GetDeviceType() const; 46 int32_t GetDeviceState() const; 47 bool Marshalling(Parcel& parcel) const override; 48 49 private: 50 std::string deviceName_; 51 int32_t deviceType_ = UNKNOWN_TYPE; 52 std::string networkId_; 53 int32_t deviceState_ = UNKNOWN_STATE; 54 }; 55 } // namespace DistributedSchedule 56 } // namespace OHOS 57 58 #endif /* OHOS_DISTRIBUTED_DMS_DEVICE_INFO_H */ 59