Add USBCANFD transport and visualize 0x391 door feedback
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace cms {
|
||||
struct CanConfig {
|
||||
bool enabled{true};
|
||||
int device_index{0};
|
||||
int timeout_ms{1000};
|
||||
bool termination{true};
|
||||
};
|
||||
struct CanDoorSignals {
|
||||
// Raw unsigned bytes: left front, right front, left rear, right rear.
|
||||
// No scale/unit is specified in the reference protocol.
|
||||
std::array<int,4> positions{{-1,-1,-1,-1}};
|
||||
bool valid{},fd{},extended{};
|
||||
std::uint64_t received{},received_monotonic_ns{};
|
||||
std::uint32_t device_timestamp_us{};
|
||||
double age_ms{-1};
|
||||
};
|
||||
struct CanSnapshot {
|
||||
std::string source{"live"},status{"DISABLED"};
|
||||
std::array<CanDoorSignals,2> channels;
|
||||
std::uint64_t received{},transmitted{},transmit_errors{},receive_errors{};
|
||||
};
|
||||
struct CanFrame {
|
||||
int channel{};
|
||||
std::uint32_t id{};
|
||||
bool fd{},extended{},bitrate_switch{};
|
||||
std::vector<std::uint8_t> data;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user