mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-18 19:03:42 +08:00
0b2c431d3a
version: sunnypilot v2026.003.000 (dev)
date: 2026-09-14T15:43:39
master commit: a5f44653d7
26 lines
566 B
C++
26 lines
566 B
C++
#pragma once
|
|
|
|
#include "tools/cabana/streams/livestream.h"
|
|
|
|
struct SocketCanStreamConfig {
|
|
std::string device = ""; // TODO: support multiple devices/buses at once
|
|
};
|
|
|
|
class SocketCanStream : public LiveStream {
|
|
public:
|
|
SocketCanStream(SocketCanStreamConfig config_ = {});
|
|
~SocketCanStream();
|
|
static bool available();
|
|
|
|
inline std::string routeName() const override {
|
|
return "Live Streaming From Socket CAN " + config.device;
|
|
}
|
|
|
|
protected:
|
|
void streamThread() override;
|
|
bool connect();
|
|
|
|
SocketCanStreamConfig config = {};
|
|
int sock_fd = -1;
|
|
};
|