Skip to content

Commit

Permalink
Rename several IM message with Message postfix (#11289)
Browse files Browse the repository at this point in the history
* Rename several IM message with Message postfix

-- Per IM spec, need to update SubscribeRequest/Response, ReadRequest, ReportData, StatusResponse wtih Message postfix
  • Loading branch information
yunhanw-google authored Nov 2, 2021
1 parent 2fe9024 commit 12ec702
Show file tree
Hide file tree
Showing 33 changed files with 316 additions and 310 deletions.
18 changes: 9 additions & 9 deletions src/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ static_library("app") {
"MessageDef/MessageDefHelper.h",
"MessageDef/Parser.cpp",
"MessageDef/Parser.h",
"MessageDef/ReadRequest.cpp",
"MessageDef/ReadRequest.h",
"MessageDef/ReportData.cpp",
"MessageDef/ReportData.h",
"MessageDef/ReadRequestMessage.cpp",
"MessageDef/ReadRequestMessage.h",
"MessageDef/ReportDataMessage.cpp",
"MessageDef/ReportDataMessage.h",
"MessageDef/StatusIB.cpp",
"MessageDef/StatusIB.h",
"MessageDef/StatusResponse.cpp",
"MessageDef/StatusResponseMessage.cpp",
"MessageDef/StructBuilder.cpp",
"MessageDef/StructParser.cpp",
"MessageDef/SubscribeRequest.cpp",
"MessageDef/SubscribeResponse.cpp",
"MessageDef/SubscribeRequestMessage.cpp",
"MessageDef/SubscribeResponseMessage.cpp",
"MessageDef/TimedRequestMessage.cpp",
"MessageDef/WriteRequest.cpp",
"MessageDef/WriteResponse.cpp",
"MessageDef/WriteRequestMessage.cpp",
"MessageDef/WriteResponseMessage.cpp",
"ReadClient.cpp",
"ReadHandler.cpp",
"WriteClient.cpp",
Expand Down
4 changes: 2 additions & 2 deletions src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ CHIP_ERROR InteractionModelEngine::OnReadInitialRequest(Messaging::ExchangeConte
System::PacketBufferTLVReader reader;
reader.Init(aPayload.Retain());
SuccessOrExit(err = reader.Next());
SubscribeRequest::Parser subscribeRequestParser;
SubscribeRequestMessage::Parser subscribeRequestParser;
SuccessOrExit(err = subscribeRequestParser.Init(reader));
err = subscribeRequestParser.GetKeepSubscriptions(&keepSubscriptions);
if (err == CHIP_NO_ERROR && !keepSubscriptions)
Expand Down Expand Up @@ -364,7 +364,7 @@ CHIP_ERROR InteractionModelEngine::OnUnsolicitedReportData(Messaging::ExchangeCo
reader.Init(aPayload.Retain());
ReturnLogErrorOnFailure(reader.Next());

ReportData::Parser report;
ReportDataMessage::Parser report;
ReturnLogErrorOnFailure(report.Init(reader));

uint64_t subscriptionId = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/app/InteractionModelEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#pragma once

#include <app/MessageDef/ReportData.h>
#include <app/MessageDef/ReportDataMessage.h>
#include <lib/core/CHIPCore.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/DLLUtil.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
/**
* @file
* This file defines ReadRequest parser and builder in CHIP interaction model
* This file defines ReadRequestMessage parser and builder in CHIP interaction model
*
*/

#include "ReadRequest.h"
#include "ReadRequestMessage.h"
#include "MessageDefHelper.h"

#include <inttypes.h>
Expand All @@ -33,7 +33,7 @@ using namespace chip::TLV;

namespace chip {
namespace app {
CHIP_ERROR ReadRequest::Parser::Init(const chip::TLV::TLVReader & aReader)
CHIP_ERROR ReadRequestMessage::Parser::Init(const chip::TLV::TLVReader & aReader)
{
CHIP_ERROR err = CHIP_NO_ERROR;

Expand All @@ -50,15 +50,15 @@ CHIP_ERROR ReadRequest::Parser::Init(const chip::TLV::TLVReader & aReader)
}

#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK
CHIP_ERROR ReadRequest::Parser::CheckSchemaValidity() const
CHIP_ERROR ReadRequestMessage::Parser::CheckSchemaValidity() const
{
CHIP_ERROR err = CHIP_NO_ERROR;
uint16_t TagPresenceMask = 0;
chip::TLV::TLVReader reader;
AttributePathList::Parser attributePathList;
EventPaths::Parser eventPathList;
AttributeDataVersionList::Parser attributeDataVersionList;
PRETTY_PRINT("ReadRequest =");
PRETTY_PRINT("ReadRequestMessage =");
PRETTY_PRINT("{");

// make a copy of the reader
Expand Down Expand Up @@ -161,7 +161,7 @@ CHIP_ERROR ReadRequest::Parser::CheckSchemaValidity() const
}
#endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK

CHIP_ERROR ReadRequest::Parser::GetAttributePathList(AttributePathList::Parser * const apAttributePathList) const
CHIP_ERROR ReadRequestMessage::Parser::GetAttributePathList(AttributePathList::Parser * const apAttributePathList) const
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVReader reader;
Expand All @@ -180,7 +180,7 @@ CHIP_ERROR ReadRequest::Parser::GetAttributePathList(AttributePathList::Parser *
return err;
}

CHIP_ERROR ReadRequest::Parser::GetEventPaths(EventPaths::Parser * const apEventPaths) const
CHIP_ERROR ReadRequestMessage::Parser::GetEventPaths(EventPaths::Parser * const apEventPaths) const
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVReader reader;
Expand All @@ -200,7 +200,7 @@ CHIP_ERROR ReadRequest::Parser::GetEventPaths(EventPaths::Parser * const apEvent
}

CHIP_ERROR
ReadRequest::Parser::GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const
ReadRequestMessage::Parser::GetAttributeDataVersionList(AttributeDataVersionList::Parser * const apAttributeDataVersionList) const
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVReader reader;
Expand All @@ -219,17 +219,17 @@ ReadRequest::Parser::GetAttributeDataVersionList(AttributeDataVersionList::Parse
return err;
}

CHIP_ERROR ReadRequest::Parser::GetEventNumber(uint64_t * const apEventNumber) const
CHIP_ERROR ReadRequestMessage::Parser::GetEventNumber(uint64_t * const apEventNumber) const
{
return GetUnsignedInteger(kCsTag_EventNumber, apEventNumber);
}

CHIP_ERROR ReadRequest::Builder::Init(chip::TLV::TLVWriter * const apWriter)
CHIP_ERROR ReadRequestMessage::Builder::Init(chip::TLV::TLVWriter * const apWriter)
{
return InitAnonymousStructure(apWriter);
}

AttributePathList::Builder & ReadRequest::Builder::CreateAttributePathListBuilder()
AttributePathList::Builder & ReadRequestMessage::Builder::CreateAttributePathListBuilder()
{
// skip if error has already been set
VerifyOrExit(CHIP_NO_ERROR == mError, mAttributePathListBuilder.ResetError(mError));
Expand All @@ -241,7 +241,7 @@ AttributePathList::Builder & ReadRequest::Builder::CreateAttributePathListBuilde
return mAttributePathListBuilder;
}

EventPaths::Builder & ReadRequest::Builder::CreateEventPathsBuilder()
EventPaths::Builder & ReadRequestMessage::Builder::CreateEventPathsBuilder()
{
// skip if error has already been set
VerifyOrExit(CHIP_NO_ERROR == mError, mEventPathsBuilder.ResetError(mError));
Expand All @@ -253,7 +253,7 @@ EventPaths::Builder & ReadRequest::Builder::CreateEventPathsBuilder()
return mEventPathsBuilder;
}

AttributeDataVersionList::Builder & ReadRequest::Builder::CreateAttributeDataVersionListBuilder()
AttributeDataVersionList::Builder & ReadRequestMessage::Builder::CreateAttributeDataVersionListBuilder()
{
// skip if error has already been set
VerifyOrExit(CHIP_NO_ERROR == mError, mAttributeDataVersionListBuilder.ResetError(mError));
Expand All @@ -265,7 +265,7 @@ AttributeDataVersionList::Builder & ReadRequest::Builder::CreateAttributeDataVer
return mAttributeDataVersionListBuilder;
}

ReadRequest::Builder & ReadRequest::Builder::EventNumber(const uint64_t aEventNumber)
ReadRequestMessage::Builder & ReadRequestMessage::Builder::EventNumber(const uint64_t aEventNumber)
{
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
Expand All @@ -275,7 +275,7 @@ ReadRequest::Builder & ReadRequest::Builder::EventNumber(const uint64_t aEventNu
return *this;
}

ReadRequest::Builder & ReadRequest::Builder::EndOfReadRequest()
ReadRequestMessage::Builder & ReadRequestMessage::Builder::EndOfReadRequestMessage()
{
EndOfContainer();
return *this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
/**
* @file
* This file defines ReadRequest parser and builder in CHIP interaction model
* This file defines ReadRequestMessage parser and builder in CHIP interaction model
*
*/

Expand All @@ -39,7 +39,7 @@

namespace chip {
namespace app {
namespace ReadRequest {
namespace ReadRequestMessage {
enum
{
kCsTag_AttributePathList = 0,
Expand Down Expand Up @@ -121,7 +121,7 @@ class Builder : public chip::app::Builder
{
public:
/**
* @brief Initialize a ReadRequest::Builder for writing into a TLV stream
* @brief Initialize a ReadRequestMessage::Builder for writing into a TLV stream
*
* @param [in] apWriter A pointer to TLVWriter
*
Expand Down Expand Up @@ -156,19 +156,19 @@ class Builder : public chip::app::Builder
* @param [in] aEventNumber The event number
* @return A reference to *this
*/
ReadRequest::Builder & EventNumber(const uint64_t aEventNumber);
ReadRequestMessage::Builder & EventNumber(const uint64_t aEventNumber);
/**
* @brief Mark the end of this ReadRequest
* @brief Mark the end of this ReadRequestMessage
*
* @return A reference to *this
*/
ReadRequest::Builder & EndOfReadRequest();
ReadRequestMessage::Builder & EndOfReadRequestMessage();

private:
AttributePathList::Builder mAttributePathListBuilder;
EventPaths::Builder mEventPathsBuilder;
AttributeDataVersionList::Builder mAttributeDataVersionListBuilder;
};
}; // namespace ReadRequest
}; // namespace ReadRequestMessage
}; // namespace app
}; // namespace chip
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
*/
/**
* @file
* This file defines ReportData parser and builder in CHIP interaction model
* This file defines ReportDataMessage parser and builder in CHIP interaction model
*
*/

#include "ReportData.h"
#include "ReportDataMessage.h"

#include "MessageDefHelper.h"

Expand All @@ -36,7 +36,7 @@ using namespace chip::TLV;

namespace chip {
namespace app {
CHIP_ERROR ReportData::Parser::Init(const chip::TLV::TLVReader & aReader)
CHIP_ERROR ReportDataMessage::Parser::Init(const chip::TLV::TLVReader & aReader)
{
CHIP_ERROR err = CHIP_NO_ERROR;

Expand All @@ -53,15 +53,15 @@ CHIP_ERROR ReportData::Parser::Init(const chip::TLV::TLVReader & aReader)
}

#if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK
CHIP_ERROR ReportData::Parser::CheckSchemaValidity() const
CHIP_ERROR ReportDataMessage::Parser::CheckSchemaValidity() const
{
CHIP_ERROR err = CHIP_NO_ERROR;
uint16_t TagPresenceMask = 0;
chip::TLV::TLVReader reader;
AttributeDataList::Parser attributeDataList;
EventList::Parser eventList;

PRETTY_PRINT("ReportData =");
PRETTY_PRINT("ReportDataMessage =");
PRETTY_PRINT("{");

// make a copy of the reader
Expand Down Expand Up @@ -165,17 +165,17 @@ CHIP_ERROR ReportData::Parser::CheckSchemaValidity() const
}
#endif // CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK

CHIP_ERROR ReportData::Parser::GetSuppressResponse(bool * const apSuppressResponse) const
CHIP_ERROR ReportDataMessage::Parser::GetSuppressResponse(bool * const apSuppressResponse) const
{
return GetSimpleValue(kCsTag_SuppressResponse, chip::TLV::kTLVType_Boolean, apSuppressResponse);
}

CHIP_ERROR ReportData::Parser::GetSubscriptionId(uint64_t * const apSubscriptionId) const
CHIP_ERROR ReportDataMessage::Parser::GetSubscriptionId(uint64_t * const apSubscriptionId) const
{
return GetUnsignedInteger(kCsTag_SubscriptionId, apSubscriptionId);
}

CHIP_ERROR ReportData::Parser::GetAttributeDataList(AttributeDataList::Parser * const apAttributeDataList) const
CHIP_ERROR ReportDataMessage::Parser::GetAttributeDataList(AttributeDataList::Parser * const apAttributeDataList) const
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVReader reader;
Expand All @@ -194,7 +194,7 @@ CHIP_ERROR ReportData::Parser::GetAttributeDataList(AttributeDataList::Parser *
return err;
}

CHIP_ERROR ReportData::Parser::GetEventDataList(EventList::Parser * const apEventDataList) const
CHIP_ERROR ReportDataMessage::Parser::GetEventDataList(EventList::Parser * const apEventDataList) const
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::TLV::TLVReader reader;
Expand All @@ -213,17 +213,17 @@ CHIP_ERROR ReportData::Parser::GetEventDataList(EventList::Parser * const apEven
return err;
}

CHIP_ERROR ReportData::Parser::GetMoreChunkedMessages(bool * const apMoreChunkedMessages) const
CHIP_ERROR ReportDataMessage::Parser::GetMoreChunkedMessages(bool * const apMoreChunkedMessages) const
{
return GetSimpleValue(kCsTag_MoreChunkedMessages, chip::TLV::kTLVType_Boolean, apMoreChunkedMessages);
}

CHIP_ERROR ReportData::Builder::Init(chip::TLV::TLVWriter * const apWriter)
CHIP_ERROR ReportDataMessage::Builder::Init(chip::TLV::TLVWriter * const apWriter)
{
return InitAnonymousStructure(apWriter);
}

ReportData::Builder & ReportData::Builder::SuppressResponse(const bool aSuppressResponse)
ReportDataMessage::Builder & ReportDataMessage::Builder::SuppressResponse(const bool aSuppressResponse)
{
// skip if error has already been set
SuccessOrExit(mError);
Expand All @@ -233,7 +233,7 @@ ReportData::Builder & ReportData::Builder::SuppressResponse(const bool aSuppress
return *this;
}

ReportData::Builder & ReportData::Builder::SubscriptionId(const uint64_t aSubscriptionId)
ReportDataMessage::Builder & ReportDataMessage::Builder::SubscriptionId(const uint64_t aSubscriptionId)
{
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
Expand All @@ -243,7 +243,7 @@ ReportData::Builder & ReportData::Builder::SubscriptionId(const uint64_t aSubscr
return *this;
}

AttributeDataList::Builder & ReportData::Builder::CreateAttributeDataListBuilder()
AttributeDataList::Builder & ReportDataMessage::Builder::CreateAttributeDataListBuilder()
{
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
Expand All @@ -257,7 +257,7 @@ AttributeDataList::Builder & ReportData::Builder::CreateAttributeDataListBuilder
return mAttributeDataListBuilder;
}

EventList::Builder & ReportData::Builder::CreateEventDataListBuilder()
EventList::Builder & ReportDataMessage::Builder::CreateEventDataListBuilder()
{
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
Expand All @@ -271,7 +271,7 @@ EventList::Builder & ReportData::Builder::CreateEventDataListBuilder()
return mEventDataListBuilder;
}

ReportData::Builder & ReportData::Builder::MoreChunkedMessages(const bool aMoreChunkedMessages)
ReportDataMessage::Builder & ReportDataMessage::Builder::MoreChunkedMessages(const bool aMoreChunkedMessages)
{
// skip if error has already been set
if (mError == CHIP_NO_ERROR)
Expand All @@ -281,7 +281,7 @@ ReportData::Builder & ReportData::Builder::MoreChunkedMessages(const bool aMoreC
return *this;
}

ReportData::Builder & ReportData::Builder::EndOfReportData()
ReportDataMessage::Builder & ReportDataMessage::Builder::EndOfReportDataMessage()
{
EndOfContainer();
return *this;
Expand Down
Loading

0 comments on commit 12ec702

Please sign in to comment.