components/esp_matter: move jsontlv utilities to dedicated subdirectory

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
This commit is contained in:
Zhibin (Ryan) Wen
2026-03-26 20:40:22 +08:00
parent d921bef8b5
commit a06ec909f9
4 changed files with 48 additions and 26 deletions
+2
View File
@@ -1,10 +1,12 @@
set(SRC_DIRS_LIST "." set(SRC_DIRS_LIST "."
"utils" "utils"
"utils/jsontlv"
"${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes" "${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes"
) )
set(INCLUDE_DIRS_LIST "." set(INCLUDE_DIRS_LIST "."
"utils" "utils"
"utils/jsontlv"
"data_model_provider" "data_model_provider"
"${MATTER_SDK_PATH}/zzz_generated/app-common" "${MATTER_SDK_PATH}/zzz_generated/app-common"
"${MATTER_SDK_PATH}/third_party/nlfaultinjection/include" "${MATTER_SDK_PATH}/third_party/nlfaultinjection/include"
@@ -0,0 +1,43 @@
// Copyright 2026 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
namespace esp_matter {
namespace element_type {
// Supported Data Type
const char k_int8[] = "I8";
const char k_int16[] = "I16";
const char k_int32[] = "I32";
const char k_int64[] = "I64";
const char k_uint8[] = "U8";
const char k_uint16[] = "U16";
const char k_uint32[] = "U32";
const char k_uint64[] = "U64";
const char k_bool[] = "BOOL";
const char k_float[] = "FP";
const char k_double[] = "DFP";
const char k_bytes[] = "BYT";
const char k_string[] = "STR";
const char k_null[] = "NULL";
const char k_object[] = "OBJ";
const char k_array[] = "ARR";
const char k_empty[] = "?";
const char k_floating_point_positive_infinity[] = "INF";
const char k_floating_point_negative_infinity[] = "-INF";
} // namespace element_type
} // namespace esp_matter
@@ -1,4 +1,4 @@
// Copyright 2023 Espressif Systems (Shanghai) PTE LTD // Copyright 2023-2026 Espressif Systems (Shanghai) PTE LTD
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
#include <algorithm> #include <algorithm>
#include <cJSON.h> #include <cJSON.h>
#include <element_types.h>
#include <esp_check.h> #include <esp_check.h>
#include <esp_matter_mem.h> #include <esp_matter_mem.h>
#include <json_to_tlv.h> #include <json_to_tlv.h>
@@ -1,4 +1,4 @@
// Copyright 2023 Espressif Systems (Shanghai) PTE LTD // Copyright 2023-2026 Espressif Systems (Shanghai) PTE LTD
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -21,30 +21,6 @@
namespace esp_matter { namespace esp_matter {
namespace element_type {
// Supported Data Type
const char k_int8[] = "I8";
const char k_int16[] = "I16";
const char k_int32[] = "I32";
const char k_int64[] = "I64";
const char k_uint8[] = "U8";
const char k_uint16[] = "U16";
const char k_uint32[] = "U32";
const char k_uint64[] = "U64";
const char k_bool[] = "BOOL";
const char k_float[] = "FP";
const char k_double[] = "DFP";
const char k_bytes[] = "BYT";
const char k_string[] = "STR";
const char k_null[] = "NULL";
const char k_object[] = "OBJ";
const char k_array[] = "ARR";
const char k_empty[] = "?";
const char k_floating_point_positive_infinity[] = "INF";
const char k_floating_point_negative_infinity[] = "-INF";
} // namespace element_type
/** Convert a JSON object to the given TLVWriter /** Convert a JSON object to the given TLVWriter
* *
* @param[in] json_str The JSON string that represents a TLV structure * @param[in] json_str The JSON string that represents a TLV structure