1 /*
2 * Copyright (c) 2022-2022 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 #ifndef LOG_TAG
16 #define LOG_TAG "InterruptGroupInfo"
17 #endif
18
19 #include "audio_system_manager.h"
20
21 namespace OHOS {
22 namespace AudioStandard {
InterruptGroupInfo()23 InterruptGroupInfo::InterruptGroupInfo()
24 {
25 }
26
InterruptGroupInfo(int32_t interruptGroupId,int32_t mappingId,std::string groupName,std::string networkId,ConnectType type)27 InterruptGroupInfo::InterruptGroupInfo(int32_t interruptGroupId, int32_t mappingId, std::string groupName,
28 std::string networkId, ConnectType type) : interruptGroupId_(interruptGroupId), mappingId_(mappingId),
29 groupName_(groupName), networkId_(networkId), connectType_(type)
30 {}
31
~InterruptGroupInfo()32 InterruptGroupInfo::~InterruptGroupInfo()
33 {}
34
Marshalling(Parcel & parcel) const35 bool InterruptGroupInfo::Marshalling(Parcel &parcel) const
36 {
37 parcel.WriteInt32(interruptGroupId_);
38 parcel.WriteInt32(mappingId_);
39 parcel.WriteString(groupName_);
40 parcel.WriteString(networkId_);
41 parcel.WriteInt32(connectType_);
42 return true;
43 }
44
Unmarshalling(Parcel & in)45 sptr<InterruptGroupInfo> InterruptGroupInfo::Unmarshalling(Parcel &in)
46 {
47 sptr<InterruptGroupInfo> interruptGroupInfo = new(std::nothrow) InterruptGroupInfo();
48 if (interruptGroupInfo == nullptr) {
49 return nullptr;
50 }
51
52 interruptGroupInfo->interruptGroupId_ = in.ReadInt32();
53 interruptGroupInfo->mappingId_ = in.ReadInt32();
54 interruptGroupInfo->groupName_ = in.ReadString();
55 interruptGroupInfo->networkId_ = in.ReadString();
56 interruptGroupInfo->connectType_ = static_cast<ConnectType>(in.ReadInt32());
57 return interruptGroupInfo;
58 }
59 } // namespace AudioStandard
60 } // namespace OHOS
61