Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / lib / core / CHIPTLVDebug.hpp
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2015-2017 Nest Labs, Inc.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18
19 /**
20  *    @file
21  *      This file defines types and interfaces for debugging and
22  *      logging CHIP TLV.
23  *
24  */
25
26 #ifndef CHIPTLVDEBUG_HPP
27 #define CHIPTLVDEBUG_HPP
28
29 #include <stddef.h>
30 #include <stdint.h>
31
32 #include <core/CHIPError.h>
33 #include <core/CHIPTLV.h>
34
35 namespace chip {
36
37 namespace TLV {
38
39 /**
40  *   @namespace chip::TLV::Debug
41  *
42  *   @brief
43  *     This namespace includes types and interfaces for debugging and
44  *     logging CHIP TLV.
45  *
46  */
47 namespace Debug {
48
49 typedef void (*DumpWriter)(const char * aFormat, ...);
50
51 struct DumpContext
52 {
53     DumpWriter mWriter;
54     void * mContext;
55 };
56
57 extern const char * DecodeType(TLVType aType);
58
59 extern const char * DecodeTagControl(TLVTagControl aTagControl);
60
61 extern CHIP_ERROR DumpIterator(DumpWriter aWriter, const TLVReader & aReader);
62
63 extern CHIP_ERROR DumpHandler(const TLVReader & aReader, size_t aDepth, void * aContext);
64
65 extern CHIP_ERROR Dump(const TLVReader & aReader, DumpWriter aWriter);
66
67 } // namespace Debug
68
69 } // namespace TLV
70
71 } // namespace chip
72
73 #endif // CHIPTLVDEBUG_HPP