1 /* 2 * Copyright (c) 2022 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef SRC_MOCK_BACKEND_H__ 8 #define SRC_MOCK_BACKEND_H__ 9 10 #include <zephyr/logging/log_backend.h> 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 extern const struct log_backend_api mock_log_backend_api; 17 struct mock_log_backend { 18 bool panic; 19 }; 20 21 /** 22 * @brief This function validates the log message. 23 * 24 * @param type Field in message header to indicate the type of SyS-T message. 25 * @param optional_flags Optional Flags in message header. 26 * @param module_id ModuleID in a Message Header distinguish between multiple 27 * instances of the same Origin. 28 * @param sub_type Enumerated types for representing the sub-type of a Message. 29 * @param payload The content of the Message. 30 */ 31 void validate_log_type(const char *raw_data_str, uint32_t log_type); 32 33 #define MOCK_LOG_BACKEND_DEFINE(name, autostart) \ 34 static struct mock_log_backend name##_mock; \ 35 LOG_BACKEND_DEFINE(name, mock_log_backend_api, autostart, &name##_mock) 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 #endif /* SRC_MOCK_BACKEND_H__ */ 42