Add USBCANFD transport and visualize 0x391 door feedback
This commit is contained in:
@@ -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_;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user