diff --git a/silabs_examples/unify-matter-bridge/linux/zap-handlers/chip_types_from_json.hpp.zapt b/silabs_examples/unify-matter-bridge/linux/zap-handlers/chip_types_from_json.hpp.zapt index 15ad304d7351cc..65be526eb2939e 100644 --- a/silabs_examples/unify-matter-bridge/linux/zap-handlers/chip_types_from_json.hpp.zapt +++ b/silabs_examples/unify-matter-bridge/linux/zap-handlers/chip_types_from_json.hpp.zapt @@ -11,7 +11,7 @@ * sections of the MSLA applicable to Source Code. * ******************************************************************************/ - +#include "app/data-model/NullObject.h" // Default translation template @@ -19,7 +19,6 @@ std::optional from_json(const nlohmann::json & value) { return std::nullopt; } - /***************************** Simple types Convertes **************/ template<> inline @@ -40,7 +39,86 @@ std::optional from_json(const nlohmann::json & value) return value; } - +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} /***************************** Bitmap Convertes **************/ //{{#zcl_clusters}} //{{#zcl_bitmaps}} diff --git a/silabs_examples/unify-matter-bridge/linux/zap-handlers/gen/chip_types_from_json.hpp b/silabs_examples/unify-matter-bridge/linux/zap-handlers/gen/chip_types_from_json.hpp index 02d7b181953bf6..1e2984565403a1 100644 --- a/silabs_examples/unify-matter-bridge/linux/zap-handlers/gen/chip_types_from_json.hpp +++ b/silabs_examples/unify-matter-bridge/linux/zap-handlers/gen/chip_types_from_json.hpp @@ -11,6 +11,7 @@ * sections of the MSLA applicable to Source Code. * ******************************************************************************/ +#include "app/data-model/NullObject.h" // Default translation template @@ -18,7 +19,6 @@ std::optional from_json(const nlohmann::json & value) { return std::nullopt; } - /***************************** Simple types Convertes **************/ template <> @@ -39,6 +39,86 @@ inline std::optional from_json(const nlohmann::json & value) return value; } +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional from_json(const nlohmann::json & value) +{ + return value; +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} +template <> +inline std::optional> from_json(const nlohmann::json & value) +{ + if (value.is_null()) + { + return std::nullopt; + } + else + { + return chip::app::DataModel::Nullable(value); + } +} /***************************** Bitmap Convertes **************/ // //