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_msg(const char *type, const char *optional_flags,
32 		  const char *module_id, const char *sub_type,
33 		  const char *payload);
34 
35 #define MOCK_LOG_BACKEND_DEFINE(name, autostart) \
36 	static struct mock_log_backend name##_mock; \
37 	LOG_BACKEND_DEFINE(name, mock_log_backend_api, autostart, &name##_mock)
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif /* SRC_MOCK_BACKEND_H__ */
44