From 8e870c809c5e9a8e26d2b5e39957dc17575cd5a1 Mon Sep 17 00:00:00 2001 From: hackerman-kl Date: Sat, 29 Nov 2025 15:12:15 +0100 Subject: [PATCH] module-avb: aecp-aem: introducing seperation between milan v1.2 and legacy milan. This introduces the following changes: * Using the time at which the command was received * Preparation for the unsollicited notifications * New folder holding all the AECP_AEM commands/responses and utils * Improving the code-reusability by using common handlers --- src/modules/module-avb/aecp-aem.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/module-avb/aecp-aem.c b/src/modules/module-avb/aecp-aem.c index 8b7b4080e..b05e3a730 100644 --- a/src/modules/module-avb/aecp-aem.c +++ b/src/modules/module-avb/aecp-aem.c @@ -6,7 +6,10 @@ #include "aecp-aem.h" #include "aecp-aem-descriptors.h" #include "aecp-aem-cmds-resps/cmd-resp-helpers.h" +#include "utils.h" +/* The headers including the command and response of the system */ +//#include "aecp-aem-cmds-resps/cmd-available.h" /* ACQUIRE_ENTITY */ @@ -318,12 +321,14 @@ int avb_aecp_aem_handle_command(struct aecp *aecp, const void *m, int len) pw_log_info("mode: %s aem command %s", get_avb_mode_str(server->avb_mode), cmd_names[cmd_type]); - if (cmd_info_modes[server->avb_mode].count >= cmd_type) { + if (cmd_info_modes[server->avb_mode].count <= cmd_type) { + pw_log_warn("Too many %d vs exp. %ld\n", cmd_type, + cmd_info_modes[server->avb_mode].count); return reply_not_implemented(aecp, m, len); } info = &cmd_info_modes[server->avb_mode].cmd_info[cmd_type]; - if (info->handle_command == NULL) + if (!info || !info->handle_command ) return reply_not_implemented(aecp, m, len);