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 "sensor_channel_info.h"
17
18 namespace OHOS {
19 namespace Sensors {
SensorChannelInfo()20 SensorChannelInfo::SensorChannelInfo() : uid_(0), deviceId_(0), sensorType_(0), sensorId_(0), samplingPeriodNs_(0),
21 fifoCount_(0)
22 {}
23
GetUid() const24 int32_t SensorChannelInfo::GetUid() const
25 {
26 return uid_;
27 }
28
SetUid(int32_t uid)29 void SensorChannelInfo::SetUid(int32_t uid)
30 {
31 uid_ = uid;
32 }
33
GetPackageName() const34 std::string SensorChannelInfo::GetPackageName() const
35 {
36 return packageName_;
37 }
38
SetPackageName(const std::string & packageName)39 void SensorChannelInfo::SetPackageName(const std::string &packageName)
40 {
41 packageName_ = packageName;
42 }
43
GetDeviceId() const44 int32_t SensorChannelInfo::GetDeviceId() const
45 {
46 return deviceId_;
47 }
48
SetDeviceId(int32_t deviceId)49 void SensorChannelInfo::SetDeviceId(int32_t deviceId)
50 {
51 deviceId_ = deviceId;
52 }
53
GetSensorType() const54 int32_t SensorChannelInfo::GetSensorType() const
55 {
56 return sensorType_;
57 }
58
SetSensorType(int32_t sensorType)59 void SensorChannelInfo::SetSensorType(int32_t sensorType)
60 {
61 sensorType_ = sensorType;
62 }
63
GetSensorId() const64 int32_t SensorChannelInfo::GetSensorId() const
65 {
66 return sensorId_;
67 }
68
SetSensorId(int32_t sensorId)69 void SensorChannelInfo::SetSensorId(int32_t sensorId)
70 {
71 sensorId_ = sensorId;
72 }
73
GetSamplingPeriodNs() const74 int64_t SensorChannelInfo::GetSamplingPeriodNs() const
75 {
76 return samplingPeriodNs_;
77 }
78
SetSamplingPeriodNs(int64_t samplingPeriodNs)79 void SensorChannelInfo::SetSamplingPeriodNs(int64_t samplingPeriodNs)
80 {
81 samplingPeriodNs_ = samplingPeriodNs;
82 }
83
GetFifoCount() const84 int32_t SensorChannelInfo::GetFifoCount() const
85 {
86 return fifoCount_;
87 }
88
SetFifoCount(uint32_t fifoCount)89 void SensorChannelInfo::SetFifoCount(uint32_t fifoCount)
90 {
91 fifoCount_ = fifoCount;
92 }
93
GetCmdType() const94 std::vector<int32_t> SensorChannelInfo::GetCmdType() const
95 {
96 return cmdType_;
97 }
98
SetCmdType(const std::vector<int32_t> & cmdType)99 void SensorChannelInfo::SetCmdType(const std::vector<int32_t> &cmdType)
100 {
101 cmdType_ = cmdType;
102 }
103 } // namespace Sensors
104 } // namespace OHOS
105