#pragma once

#include <rclcpp/rclcpp.hpp>
#include <can_msgs/msg/frame.hpp>
#include <atomic>
#include <string>
#include <thread>

class CanBridgeNode : public rclcpp::Node {
public:
  CanBridgeNode();
  ~CanBridgeNode() override;

private:
  void rxLoop();

  std::string iface_;
  int sock_{-1};
  std::atomic<bool> stop_{false};
  std::thread rx_thread_;
  rclcpp::Publisher<can_msgs::msg::Frame>::SharedPtr pub_;
};
