• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 #include "deviceManager/dms_device_info.h"
17 
18 #include "dtbschedmgr_log.h"
19 #include "parcel_helper.h"
20 #include "string_ex.h"
21 
22 namespace OHOS {
23 namespace DistributedSchedule {
24 namespace {
25 const std::string TAG = "DmsDeviceInfo";
26 }
GetDeviceName() const27 const std::string& DmsDeviceInfo::GetDeviceName() const
28 {
29     return deviceName_;
30 }
31 
GetDeviceId() const32 const std::string& DmsDeviceInfo::GetDeviceId() const
33 {
34     return deviceId_;
35 }
36 
GetDeviceType() const37 int32_t DmsDeviceInfo::GetDeviceType() const
38 {
39     return deviceType_;
40 }
41 
GetDeviceState() const42 int32_t DmsDeviceInfo::GetDeviceState() const
43 {
44     return deviceState_;
45 }
46 
Marshalling(Parcel & parcel) const47 bool DmsDeviceInfo::Marshalling(Parcel& parcel) const
48 {
49     PARCEL_WRITE_HELPER_RET(parcel, String16, Str8ToStr16(deviceId_), false);
50     PARCEL_WRITE_HELPER_RET(parcel, String16, Str8ToStr16(deviceName_), false);
51     PARCEL_WRITE_HELPER_RET(parcel, Int32, deviceType_, false);
52     PARCEL_WRITE_HELPER_RET(parcel, Int32, deviceState_, false);
53     return true;
54 }
55 } // namespace DistributedSchedule
56 } // namespace OHOS