Coverage Report

Created: 2025-06-24 06:17

/src/connectedhomeip/examples/common/tracing/decoder/udc/Decoder.cpp
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *   Copyright (c) 2022 Project CHIP Authors
3
 *   All rights reserved.
4
 *
5
 *   Licensed under the Apache License, Version 2.0 (the "License");
6
 *   you may not use this file except in compliance with the License.
7
 *   You may obtain a copy of the License at
8
 *
9
 *       http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 *   Unless required by applicable law or agreed to in writing, software
12
 *   distributed under the License is distributed on an "AS IS" BASIS,
13
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 *   See the License for the specific language governing permissions and
15
 *   limitations under the License.
16
 *
17
 */
18
19
#include "Decoder.h"
20
21
#include <protocols/user_directed_commissioning/UserDirectedCommissioning.h>
22
23
namespace {
24
constexpr char kProtocolName[] = "User Directed Commissioning";
25
26
constexpr char kUnknown[]                   = "Unknown";
27
constexpr char kIdentificationDeclaration[] = "Identification Declaration";
28
} // namespace
29
30
using MessageType = chip::Protocols::UserDirectedCommissioning::MsgType;
31
32
namespace chip {
33
namespace trace {
34
namespace udc {
35
36
const char * ToProtocolName()
37
0
{
38
0
    return kProtocolName;
39
0
}
40
41
const char * ToProtocolMessageTypeName(uint8_t protocolCode)
42
0
{
43
0
    switch (protocolCode)
44
0
    {
45
0
    case to_underlying(MessageType::IdentificationDeclaration):
46
0
        return kIdentificationDeclaration;
47
0
    default:
48
0
        return kUnknown;
49
0
    }
50
0
}
51
52
CHIP_ERROR LogAsProtocolMessage(uint8_t protocolCode, const uint8_t * data, size_t len)
53
0
{
54
    // TODO Implement messages decoding
55
56
0
    switch (protocolCode)
57
0
    {
58
0
    case to_underlying(MessageType::IdentificationDeclaration):
59
0
        return CHIP_ERROR_NOT_IMPLEMENTED;
60
0
    default:
61
0
        return CHIP_ERROR_NOT_IMPLEMENTED;
62
0
    }
63
0
}
64
65
} // namespace udc
66
} // namespace trace
67
} // namespace chip