RemoteDataModelLogger.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2023 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. #pragma once
  19. #include <app/ConcreteAttributePath.h>
  20. #include <app/ConcreteCommandPath.h>
  21. #include <app/EventHeader.h>
  22. #include <app/MessageDef/StatusIB.h>
  23. #include <crypto/CHIPCryptoPAL.h>
  24. #include <lib/dnssd/Resolver.h>
  25. class RemoteDataModelLoggerDelegate
  26. {
  27. public:
  28. CHIP_ERROR virtual LogJSON(const char *) = 0;
  29. virtual ~RemoteDataModelLoggerDelegate(){};
  30. };
  31. namespace RemoteDataModelLogger {
  32. CHIP_ERROR LogAttributeAsJSON(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data);
  33. CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteDataAttributePath & path, const chip::app::StatusIB & status);
  34. CHIP_ERROR LogCommandAsJSON(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader * data);
  35. CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteCommandPath & path, const chip::app::StatusIB & status);
  36. CHIP_ERROR LogEventAsJSON(const chip::app::EventHeader & header, chip::TLV::TLVReader * data);
  37. CHIP_ERROR LogErrorAsJSON(const chip::app::EventHeader & header, const chip::app::StatusIB & status);
  38. CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error);
  39. CHIP_ERROR LogGetCommissionerNodeId(chip::NodeId value);
  40. CHIP_ERROR LogGetCommissionerRootCertificate(const char * value);
  41. CHIP_ERROR LogIssueNOCChain(const char * noc, const char * icac, const char * rcac, const char * ipk);
  42. CHIP_ERROR LogDiscoveredNodeData(const chip::Dnssd::DiscoveredNodeData & nodeData);
  43. void SetDelegate(RemoteDataModelLoggerDelegate * delegate);
  44. }; // namespace RemoteDataModelLogger