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_basic_info.h" 17 18 namespace OHOS { 19 namespace Sensors { SensorBasicInfo()20SensorBasicInfo::SensorBasicInfo() : samplingPeriodNs_(0L), maxReportDelayNs_(0L), sensorState_(false) 21 {} 22 GetSamplingPeriodNs() const23int64_t SensorBasicInfo::GetSamplingPeriodNs() const 24 { 25 return samplingPeriodNs_; 26 } 27 SetSamplingPeriodNs(int64_t samplingPeriodNs)28void SensorBasicInfo::SetSamplingPeriodNs(int64_t samplingPeriodNs) 29 { 30 samplingPeriodNs_ = samplingPeriodNs; 31 } 32 GetMaxReportDelayNs() const33int64_t SensorBasicInfo::GetMaxReportDelayNs() const 34 { 35 return maxReportDelayNs_; 36 } 37 SetMaxReportDelayNs(int64_t maxReportDelayNs)38void SensorBasicInfo::SetMaxReportDelayNs(int64_t maxReportDelayNs) 39 { 40 maxReportDelayNs_ = maxReportDelayNs; 41 } 42 GetSensorState() const43bool SensorBasicInfo::GetSensorState() const 44 { 45 return sensorState_; 46 } 47 SetSensorState(bool sensorState)48void SensorBasicInfo::SetSensorState(bool sensorState) 49 { 50 sensorState_ = sensorState; 51 } 52 GetPermState() const53bool SensorBasicInfo::GetPermState() const 54 { 55 return permState_; 56 } 57 SetPermState(bool permState)58void SensorBasicInfo::SetPermState(bool permState) 59 { 60 permState_ = permState; 61 } 62 } // namespace Sensors 63 } // namespace OHOS 64