Add USBCANFD transport and visualize 0x391 door feedback

This commit is contained in:
zmv
2026-09-24 15:41:49 +08:00
parent 475fe2440b
commit 515a9f32d8
37 changed files with 1074 additions and 13 deletions
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include "can_types.hpp"
#include <memory>
namespace cms {
// One lifecycle per instance; only one owner per device index in a process.
// start() must run after StopSignals so the receiver inherits its signal mask.
// Missing hardware is reported by snapshot(), and does not stop inference.
class CanBus {
public:
explicit CanBus(CanConfig config);
~CanBus();
CanBus(CanBus const&)=delete;
CanBus& operator=(CanBus const&)=delete;
void start();
void requestStop() noexcept;
void join() noexcept;
CanSnapshot snapshot() const;
// Thread-safe on-demand data-frame send; invalid frames throw, SDK failure
// returns false. Never generates periodic or inference-triggered messages.
bool send(CanFrame const& frame);
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
}