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
This commit is contained in:
hackerman-kl 2025-11-29 15:12:15 +01:00 committed by Wim Taymans
parent 5eea411a3c
commit 8e870c809c

View file

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