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 STATIONARY_PARAMS_H 17 #define STATIONARY_PARAMS_H 18 19 #include "intention_identity.h" 20 #include "stationary_callback.h" 21 22 namespace OHOS { 23 namespace Msdp { 24 namespace DeviceStatus { 25 enum StationaryRequestID : uint32_t { 26 UNKNOWN_STATIONARY_REQUEST, 27 SUBSCRIBE_STATIONARY, 28 UNSUBSCRIBE_STATIONARY, 29 GET_STATIONARY_DATA, 30 }; 31 32 struct SubscribeStationaryParam final : public ParamBase { 33 SubscribeStationaryParam() = default; 34 SubscribeStationaryParam(Type type, ActivityEvent event, 35 ReportLatencyNs latency, sptr<IRemoteDevStaCallback> callback); 36 37 bool Marshalling(MessageParcel &parcel) const override; 38 bool Unmarshalling(MessageParcel &parcel) override; 39 40 Type type_; 41 ActivityEvent event_; 42 ReportLatencyNs latency_; 43 sptr<IRemoteDevStaCallback> callback_; 44 }; 45 46 using UnsubscribeStationaryParam = SubscribeStationaryParam; 47 48 struct GetStaionaryDataParam final : public ParamBase { 49 GetStaionaryDataParam() = default; 50 explicit GetStaionaryDataParam(Type type); 51 52 bool Marshalling(MessageParcel &parcel) const override; 53 bool Unmarshalling(MessageParcel &parcel) override; 54 55 Type type_ { Type::TYPE_INVALID }; 56 }; 57 58 struct GetStaionaryDataReply final : public ParamBase { 59 GetStaionaryDataReply() = default; 60 explicit GetStaionaryDataReply(Data data); 61 62 bool Marshalling(MessageParcel &parcel) const override; 63 bool Unmarshalling(MessageParcel &parcel) override; 64 65 Data data_ {}; 66 }; 67 } // namespace DeviceStatus 68 } // namespace Msdp 69 } // namespace OHOS 70 #endif // STATIONARY_PARAMS_H 71