summaryrefslogtreecommitdiff
path: root/include/host_command.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/host_command.h')
-rw-r--r--include/host_command.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/host_command.h b/include/host_command.h
index 15cca98d96..ccf86214aa 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -349,4 +349,20 @@ void host_send_sysrq(uint8_t key);
uint32_t get_feature_flags0(void);
uint32_t get_feature_flags1(void);
+#ifdef CONFIG_ZTEST
+static inline void
+stub_send_response_callback(struct host_cmd_handler_args *args)
+{
+ ARG_UNUSED(args);
+}
+
+#define BUILD_HOST_COMMAND(CMD, VERSION, RESPONSE) \
+ { \
+ .command = (CMD), .version = (VERSION), \
+ .send_response = stub_send_response_callback, \
+ .response = &(RESPONSE), .response_max = sizeof(RESPONSE), \
+ .response_size = sizeof(RESPONSE) \
+ }
+#endif /* CONFIG_ZTEST */
+
#endif /* __CROS_EC_HOST_COMMAND_H */