1 /* 2 * Copyright (c) 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 ACTIVE_INFO_H 17 #define ACTIVE_INFO_H 18 19 #include "parcel.h" 20 21 namespace OHOS { 22 namespace Sensors { 23 class ActiveInfo : public Parcelable { 24 public: 25 ActiveInfo() = default; 26 ActiveInfo(int32_t pid, int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs); 27 ~ActiveInfo() = default; 28 int32_t GetPid() const; 29 void SetPid(int32_t pid); 30 int32_t GetSensorId() const; 31 void SetSensorId(int32_t sensorId); 32 int64_t GetSamplingPeriodNs() const; 33 void SetSamplingPeriodNs(int64_t samplingPeriodNs); 34 int64_t GetMaxReportDelayNs() const; 35 void SetMaxReportDelayNs(int64_t maxReportDelayNs); 36 bool Marshalling(Parcel &parcel) const; 37 std::unique_ptr<ActiveInfo> Unmarshalling(Parcel &parcel); 38 39 private: 40 int32_t pid_ { -1 }; 41 int32_t sensorId_ { -1 }; 42 int64_t samplingPeriodNs_ { -1 }; 43 int64_t maxReportDelayNs_ { -1 }; 44 }; 45 } // namespace Sensors 46 } // namespace OHOS 47 #endif // ACTIVE_INFO_H