Matter SDK Coverage Report
Current view: top level - app/MessageDef - MessageParser.cpp (source / functions) Coverage Total Hit
Test: SHA:4cbce7f768f16e614f5a8ccb8cd93c92cbeae70d Lines: 85.7 % 14 12
Test Date: 2025-04-26 07:09:35 Functions: 75.0 % 4 3

            Line data    Source code
       1              : /**
       2              :  *
       3              :  *    Copyright (c) 2021 Project CHIP Authors
       4              :  *    Licensed under the Apache License, Version 2.0 (the "License");
       5              :  *    you may not use this file except in compliance with the License.
       6              :  *    You may obtain a copy of the License at
       7              :  *
       8              :  *        http://www.apache.org/licenses/LICENSE-2.0
       9              :  *
      10              :  *    Unless required by applicable law or agreed to in writing, software
      11              :  *    distributed under the License is distributed on an "AS IS" BASIS,
      12              :  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      13              :  *    See the License for the specific language governing permissions and
      14              :  *    limitations under the License.
      15              :  */
      16              : 
      17              : #include "MessageParser.h"
      18              : #include "MessageDefHelper.h"
      19              : #include <app/SpecificationDefinedRevisions.h>
      20              : 
      21              : namespace chip {
      22              : namespace app {
      23        12758 : CHIP_ERROR MessageParser::Init(TLV::TLVReader & aReader)
      24              : {
      25        12758 :     ReturnErrorOnFailure(aReader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag()));
      26        12756 :     return StructParser::Init(aReader);
      27              : }
      28              : 
      29        11639 : CHIP_ERROR MessageParser::ExitContainer()
      30              : {
      31              :     // Ignore any other tags that might be here.
      32        11639 :     ReturnErrorOnFailure(mReader.ExitContainer(mOuterContainerType));
      33              : 
      34              :     // There should be nothing outside the toplevel struct.
      35        11638 :     VerifyOrReturnError(mReader.Next() == CHIP_END_OF_TLV, CHIP_ERROR_INVALID_TLV_TAG);
      36        11638 :     return CHIP_NO_ERROR;
      37              : }
      38              : 
      39              : #if CHIP_CONFIG_IM_PRETTY_PRINT
      40        11562 : CHIP_ERROR MessageParser::CheckInteractionModelRevision(TLV::TLVReader & aReader) const
      41              : {
      42              : #if CHIP_DETAIL_LOGGING
      43              :     {
      44        11562 :         uint8_t interactionModelRevision = 0;
      45        11562 :         ReturnErrorOnFailure(aReader.Get(interactionModelRevision));
      46        11562 :         PRETTY_PRINT("\tInteractionModelRevision = %u", interactionModelRevision);
      47              :     }
      48              : #endif // CHIP_DETAIL_LOGGING
      49        11562 :     return CHIP_NO_ERROR;
      50              : }
      51              : #endif // CHIP_CONFIG_IM_PRETTY_PRINT
      52              : 
      53            0 : CHIP_ERROR MessageParser::GetInteractionModelRevision(InteractionModelRevision * const apInteractionModelRevision) const
      54              : {
      55            0 :     return GetUnsignedInteger(Revision::kInteractionModelRevisionTag, apInteractionModelRevision);
      56              : }
      57              : 
      58              : } // namespace app
      59              : } // namespace chip
        

Generated by: LCOV version 2.0-1