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), sensorId_(0), samplingPeriodNs_(0), fifoCount_(0)
21 {}
22 
GetUid() const23 int32_t SensorChannelInfo::GetUid() const
24 {
25     return uid_;
26 }
27 
SetUid(int32_t uid)28 void SensorChannelInfo::SetUid(int32_t uid)
29 {
30     uid_ = uid;
31 }
32 
GetPackageName() const33 std::string SensorChannelInfo::GetPackageName() const
34 {
35     return packageName_;
36 }
37 
SetPackageName(const std::string & packageName)38 void SensorChannelInfo::SetPackageName(const std::string &packageName)
39 {
40     packageName_ = packageName;
41 }
42 
GetSensorId() const43 int32_t SensorChannelInfo::GetSensorId() const
44 {
45     return sensorId_;
46 }
47 
SetSensorId(int32_t sensorId)48 void SensorChannelInfo::SetSensorId(int32_t sensorId)
49 {
50     sensorId_ = sensorId;
51 }
52 
GetSamplingPeriodNs() const53 int64_t SensorChannelInfo::GetSamplingPeriodNs() const
54 {
55     return samplingPeriodNs_;
56 }
57 
SetSamplingPeriodNs(int64_t samplingPeriodNs)58 void SensorChannelInfo::SetSamplingPeriodNs(int64_t samplingPeriodNs)
59 {
60     samplingPeriodNs_ = samplingPeriodNs;
61 }
62 
GetFifoCount() const63 int32_t SensorChannelInfo::GetFifoCount() const
64 {
65     return fifoCount_;
66 }
67 
SetFifoCount(uint32_t fifoCount)68 void SensorChannelInfo::SetFifoCount(uint32_t fifoCount)
69 {
70     fifoCount_ = fifoCount;
71 }
72 
GetCmdType() const73 std::vector<int32_t> SensorChannelInfo::GetCmdType() const
74 {
75     return cmdType_;
76 }
77 
SetCmdType(const std::vector<int32_t> & cmdType)78 void SensorChannelInfo::SetCmdType(const std::vector<int32_t> &cmdType)
79 {
80     cmdType_ = cmdType;
81 }
82 } // namespace Sensors
83 } // namespace OHOS
84