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 deviceId, int32_t sensorTypeId, int32_t sensorId, int64_t samplingPeriodNs, 27 int64_t maxReportDelayNs); 28 ~ActiveInfo() = default; 29 int32_t GetPid() const; 30 void SetPid(int32_t pid); 31 int32_t GetDeviceId() const; 32 void SetDeviceId(int32_t deviceId); 33 int32_t GetSensorTypeId() const; 34 void SetSensorTypeId(int32_t sensorTypeId); 35 int32_t GetSensorId() const; 36 void SetSensorId(int32_t sensorId); 37 int64_t GetSamplingPeriodNs() const; 38 void SetSamplingPeriodNs(int64_t samplingPeriodNs); 39 int64_t GetMaxReportDelayNs() const; 40 void SetMaxReportDelayNs(int64_t maxReportDelayNs); 41 bool Marshalling(Parcel &parcel) const; 42 static ActiveInfo* Unmarshalling(Parcel &parcel); 43 44 private: 45 int32_t pid_ { -1 }; 46 int32_t deviceId_ { -1 }; 47 int32_t sensorTypeId_ { -1 }; 48 int32_t sensorId_ { -1 }; 49 int64_t samplingPeriodNs_ { -1 }; 50 int64_t maxReportDelayNs_ { -1 }; 51 }; 52 } // namespace Sensors 53 } // namespace OHOS 54 #endif // ACTIVE_INFO_H