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);