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 COOPERATE_PARAMS_H 17 #define COOPERATE_PARAMS_H 18 19 #include "intention_identity.h" 20 21 namespace OHOS { 22 namespace Msdp { 23 namespace DeviceStatus { 24 enum CooperateRequestID : uint32_t { 25 UNKNOWN_COOPERATE_ACTION, 26 REGISTER_LISTENER, 27 UNREGISTER_LISTENER, 28 REGISTER_HOTAREA_LISTENER, 29 UNREGISTER_HOTAREA_LISTENER, 30 GET_COOPERATE_STATE, 31 }; 32 33 struct StartCooperateParam final : public ParamBase { 34 StartCooperateParam() = default; 35 StartCooperateParam(int32_t userData, const std::string &remoteNetworkId, 36 int32_t startDeviceId, bool checkPermission); 37 bool Marshalling(MessageParcel &parcel) const override; 38 bool Unmarshalling(MessageParcel &parcel) override; 39 40 std::string remoteNetworkId; 41 int32_t userData { -1 }; 42 int32_t startDeviceId { -1 }; 43 bool checkPermission { false }; 44 }; 45 46 struct StopCooperateParam final : public ParamBase { 47 StopCooperateParam() = default; 48 StopCooperateParam(int32_t userData, bool isUnchained, bool checkPermission); 49 bool Marshalling(MessageParcel &parcel) const override; 50 bool Unmarshalling(MessageParcel &parcel) override; 51 52 int32_t userData { -1 }; 53 bool isUnchained { false }; 54 bool checkPermission { false }; 55 }; 56 57 struct GetCooperateStateParam final : public ParamBase { 58 GetCooperateStateParam() = default; 59 GetCooperateStateParam(int32_t userData, const std::string &networkId, bool checkPermission); 60 bool Marshalling(MessageParcel &parcel) const override; 61 bool Unmarshalling(MessageParcel &parcel) override; 62 63 std::string networkId; 64 int32_t userData { -1 }; 65 bool checkPermission { false }; 66 }; 67 } // namespace DeviceStatus 68 } // namespace Msdp 69 } // namespace OHOS 70 #endif // COOPERATE_PARAMS_H 71