Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed Oct 31, 2024
1 parent 44484ae commit b5e7840
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
8 changes: 8 additions & 0 deletions src/app/BufferedReadCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ CHIP_ERROR BufferedReadCallback::DispatchBufferedData(const ConcreteAttributePat
void BufferedReadCallback::OnAttributeData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData,
const StatusIB & aStatus)
{
if (mLastError != CHIP_NO_ERROR)
{
ChipLogError(DataManagement,
"Skipping AttributePath: (%u, " ChipLogFormatMEI ", " ChipLogFormatMEI ") '%" CHIP_ERROR_FORMAT "'",
aPath.mEndpointId, ChipLogValueMEI(aPath.mClusterId),
ChipLogValueMEI(aPath.mAttributeId), mLastError.Format());
return;
}
//
// First, let's dispatch to our registered callback any buffered up list data from previous calls.
//
Expand Down
12 changes: 0 additions & 12 deletions src/app/BufferedReadCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ class BufferedReadCallback : public ReadClient::Callback
BufferedReadCallback(Callback & callback) : mCallback(callback) {}

private:
/*
* Get the last internal fatal error in BufferedReadCallback
* @retval #CHIP_NO_ERROR If the method succeeded.
* @retval #CHIP_ERROR_INVALID_TLV_ELEMENT
* If bufferred list data is not TLV Array
* @retval #CHIP_ERROR_NO_MEMORY
* If an attempt to allocate an buffer failed due to lack of
* memory.
* @retval other Other CHIP or platform-specific errors.
*/
CHIP_ERROR GetLastError() const override { return mLastError; }

/*
* Generates the reconstituted TLV array from the stored individual list elements
*/
Expand Down
3 changes: 2 additions & 1 deletion src/app/ReadClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,8 @@ CHIP_ERROR ReadClient::ProcessAttributeReportIBs(TLV::TLVReader & aAttributeRepo
{
err = CHIP_NO_ERROR;
}
return mpCallback.GetLastError();

return err;
}

CHIP_ERROR ReadClient::ProcessEventReportIBs(TLV::TLVReader & aEventReportIBsReader)
Expand Down
5 changes: 0 additions & 5 deletions src/app/ReadClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,6 @@ class ReadClient : public Messaging::ExchangeDelegate
* things like min/max intervals based on the session parameters).
*/
virtual void OnCASESessionEstablished(const SessionHandle & aSession, ReadPrepareParams & aSubscriptionParams) {}

/*
* Get the last internal fatal error in callback
*/
virtual CHIP_ERROR GetLastError() const { return CHIP_NO_ERROR; }
};

enum class InteractionType : uint8_t
Expand Down

0 comments on commit b5e7840

Please sign in to comment.