blob: e41c3b7d51a133664e8c106e143567a0dbda6700 [file] [log] [blame]
/*
*
* Copyright (c) 2021 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <app/AttributePathParams.h>
#include <app/EventPathParams.h>
#include <app/util/basic-types.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/CHIPTLV.h>
#include <messaging/ExchangeMgr.h>
namespace chip {
namespace app {
struct ReadPrepareParams
{
SessionHandle mSessionHandle;
EventPathParams * mpEventPathParamsList = nullptr;
size_t mEventPathParamsListSize = 0;
AttributePathParams * mpAttributePathParamsList = nullptr;
size_t mAttributePathParamsListSize = 0;
EventNumber mEventNumber = 0;
uint32_t mTimeout = kImMessageTimeoutMsec;
uint16_t mMinIntervalFloorSeconds = 0;
uint16_t mMaxIntervalCeilingSeconds = 0;
ReadPrepareParams(SessionHandle sessionHandle) : mSessionHandle(sessionHandle) {}
ReadPrepareParams(ReadPrepareParams && other) : mSessionHandle(other.mSessionHandle)
{
mpEventPathParamsList = other.mpEventPathParamsList;
mEventPathParamsListSize = other.mEventPathParamsListSize;
mpAttributePathParamsList = other.mpAttributePathParamsList;
mAttributePathParamsListSize = other.mAttributePathParamsListSize;
mEventNumber = other.mEventNumber;
mMinIntervalFloorSeconds = other.mMinIntervalFloorSeconds;
mMaxIntervalCeilingSeconds = other.mMaxIntervalCeilingSeconds;
mTimeout = other.mTimeout;
other.mpEventPathParamsList = nullptr;
other.mEventPathParamsListSize = 0;
other.mpAttributePathParamsList = nullptr;
other.mAttributePathParamsListSize = 0;
}
ReadPrepareParams & operator=(ReadPrepareParams && other)
{
if (&other == this)
return *this;
mSessionHandle = other.mSessionHandle;
mpEventPathParamsList = other.mpEventPathParamsList;
mEventPathParamsListSize = other.mEventPathParamsListSize;
mpAttributePathParamsList = other.mpAttributePathParamsList;
mAttributePathParamsListSize = other.mAttributePathParamsListSize;
mEventNumber = other.mEventNumber;
mMinIntervalFloorSeconds = other.mMinIntervalFloorSeconds;
mMaxIntervalCeilingSeconds = other.mMaxIntervalCeilingSeconds;
mTimeout = other.mTimeout;
other.mpEventPathParamsList = nullptr;
other.mEventPathParamsListSize = 0;
other.mpAttributePathParamsList = nullptr;
other.mAttributePathParamsListSize = 0;
return *this;
}
};
} // namespace app
} // namespace chip