1 /* 2 * Copyright (c) 2024 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 USB_STRUCT_PARCEL_H 17 #define USB_STRUCT_PARCEL_H 18 19 #include "parcel.h" 20 #include "v1_2/usb_types.h" 21 #ifdef USB_MANAGER_PASS_THROUGH 22 #include "v2_0/usb_types.h" 23 #endif // USB_MANAGER_PASS_THROUGH 24 25 namespace OHOS { 26 namespace USB { 27 28 struct UsbIsoParcel final : public Parcelable { 29 UsbIsoParcel() = default; 30 ~UsbIsoParcel() = default; 31 bool Marshalling(Parcel &out) const override; 32 static UsbIsoParcel *Unmarshalling(Parcel &in); 33 HDI::Usb::V1_2::UsbIsoPacketDescriptor isoInfo; 34 }; 35 36 struct UsbIsoVecParcel final : public Parcelable { 37 UsbIsoVecParcel() = default; 38 ~UsbIsoVecParcel() = default; 39 bool Marshalling(Parcel &out) const override; 40 static UsbIsoVecParcel *Unmarshalling(Parcel &in); 41 std::vector<HDI::Usb::V1_2::UsbIsoPacketDescriptor> isoInfoVec; 42 }; 43 44 #ifdef USB_MANAGER_PASS_THROUGH 45 struct UsbPassIsoParcel final : public Parcelable { 46 UsbPassIsoParcel() = default; 47 ~UsbPassIsoParcel() = default; 48 bool Marshalling(Parcel &out) const override; 49 static UsbPassIsoParcel *Unmarshalling(Parcel &in); 50 HDI::Usb::V2_0::UsbIsoPacketDescriptor isoInfo; 51 }; 52 53 struct UsbPassIsoVecParcel final : public Parcelable { 54 UsbPassIsoVecParcel() = default; 55 ~UsbPassIsoVecParcel() = default; 56 bool Marshalling(Parcel &out) const override; 57 static UsbPassIsoVecParcel *Unmarshalling(Parcel &in); 58 std::vector<HDI::Usb::V2_0::UsbIsoPacketDescriptor> isoInfoVec; 59 }; 60 #endif // USB_MANAGER_PASS_THROUGH 61 } // namespace USB 62 } // namespace OHOS 63 #endif // USB_STRUCT_PARCEL_H 64