--- /dev/null
+#pragma once\r
+\r
+#include <cstdint>\r
+#include <json.hpp>\r
+\r
+namespace openxc\r
+{\r
+ enum class can_bus_mode\r
+ {\r
+ off,\r
+ filtered,\r
+ unfiltered\r
+ };\r
+\r
+ class can_bus\r
+ {\r
+ private:\r
+ std::uint32_t controller_;\r
+ std::uint32_t speed_;\r
+ can_bus_mode raw_can_mode_;\r
+ bool raw_writable_;\r
+ float max_message_frequency_;\r
+ bool force_send_changed_;\r
+\r
+ public:\r
+ std::uint32_t controller() const;\r
+ std::uint32_t speed() const;\r
+ can_bus_mode raw_can_mode() const;\r
+ bool raw_writable() const;\r
+ float max_message_frequency() const;\r
+ bool force_send_changed() const;\r
+ \r
+ void from_json(const nlohmann::json& j);\r
+ nlohmann::json to_json() const;\r
+ };\r
+\r
+ void to_json(nlohmann::json& j, const can_bus& p);\r
+ void from_json(const nlohmann::json& j, can_bus& p);\r
+\r
+ void to_json(nlohmann::json& j, const can_bus_mode& p);\r
+ void from_json(const nlohmann::json& j, can_bus_mode& p);\r
+}\r