Parameterise Peripheral by its Devices and add CDChanger as one

This commit is contained in:
Allen Hill
2026-06-26 20:10:35 -07:00
parent d98cc8acad
commit 66bbf8639e
21 changed files with 1047 additions and 1022 deletions
+25
View File
@@ -0,0 +1,25 @@
// copyright (C) 2026 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include "avclan.hpp"
#include "avclan_defs.h"
#include <concepts>
#include <cstdint>
namespace avclan {
template <class T>
concept Device = requires { std::integral_constant<uint8_t, T::id>{}; } &&
requires(T dev, const AVCLAN_frame_t *in, AVCLAN_frame_t *out,
detail::Error::Send err) {
dev.init();
dev.handle(in, out);
dev.enable(out);
dev.react(out, err);
{ dev.pending() } -> std::convertible_to<bool>;
dev.resolvepending();
dev.emit(out);
};
} // namespace avclan