pipewire/src/modules/module-avb/aecp-aem-cmds-resps/cmd-lock-entity.h
hackerman-kl c551acf4d1 milan-avb: lock: make it lockable:
1. The period calls were added to handle timeouts.
2. Handle the case where lock must be unlocked after 60s if the
   controller owning the locked does not release it.
2026-04-16 12:42:23 +02:00

30 lines
1 KiB
C

/* AVB support */
/* SPDX-FileCopyrightText: Copyright © 2025 Kebag-Logic */
/* SPDX-FileCopyrightText: Copyright © 2025 Alex Malki <alexandre.malki@kebag-logic.com> */
/* SPDX-FileCopyrightText: Copyright © 2025 Simon Gapp <simon.gapp@kebag-logic.com> */
/* SPDX-License-Identifier: MIT */
#ifndef __AVB_AECP_AEM_LOCK_H__
#define __AVB_AECP_AEM_LOCK_H__
#define AECP_AEM_LOCK_ENTITY_EXPIRE_TIMEOUT_SECOND (60UL)
#define AECP_AEM_LOCK_ENTITY_FLAG_UNLOCK (1)
#include <stdint.h>
/**
* @brief Checks whether the Milan entity lock has expired and releases it.
*
* Called once per second from the AECP periodic handler. If the lock is
* active and its timeout (set at lock time) is earlier than @p now, the
* lock is cleared.
*/
void handle_cmd_lock_entity_expired_milan_v12(struct aecp *aecp, int64_t now);
/**
* @brief Command handling will generate the response for the lock command
*/
int handle_cmd_lock_entity_milan_v12(struct aecp *aecp, int64_t now,
const void *m, int len);
#endif //__AVB_AECP_AEM_LOCK_H__