Skip to content

Commit 5d1129a

Browse files
authored
Add get_name method to the CANHardwarePlugin
1 parent 9bd52a5 commit 5d1129a

23 files changed

+105
-0
lines changed

hardware_integration/include/isobus/hardware_integration/can_hardware_plugin.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef CAN_HARDEWARE_PLUGIN_HPP
1010
#define CAN_HARDEWARE_PLUGIN_HPP
1111

12+
#include <string>
1213
#include "isobus/isobus/can_message_frame.hpp"
1314

1415
namespace isobus
@@ -23,6 +24,11 @@ namespace isobus
2324
public:
2425
virtual ~CANHardwarePlugin() = default;
2526

27+
/// @brief Returns with the name of the plugin in a format which is suitable to be displayed
28+
/// to the user for e.g. on a ComboBox
29+
/// @returns the name of the plugin
30+
virtual std::string get_name() const = 0;
31+
2632
/// @brief Returns if the driver is ready and in a good state
2733
/// @details This should return `false` until `open` is called, and after `close` is called, or
2834
/// if anything happens that causes the driver to be invalid, like the hardware is disconnected.

hardware_integration/include/isobus/hardware_integration/flex_can_t4_plugin.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ namespace isobus
2727
/// @brief The destructor for FlexCANT4Plugin
2828
virtual ~FlexCANT4Plugin() = default;
2929

30+
/// @brief Returns the displayable name of the plugin
31+
/// @returns FlexCANT4
32+
std::string get_name() const override;
33+
3034
/// @brief Returns if the connection with the hardware is valid
3135
/// @returns `true` if connected, `false` if not connected
3236
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/innomaker_usb2can_windows_plugin.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ namespace isobus
5959
/// @brief The destructor for InnoMakerUSB2CANWindowsPlugin
6060
virtual ~InnoMakerUSB2CANWindowsPlugin();
6161

62+
/// @brief Returns the displayable name of the plugin
63+
/// @returns INNO-Maker USB2CAN
64+
std::string get_name() const override;
65+
6266
/// @brief Returns if the connection with the hardware is valid
6367
/// @returns `true` if connected, `false` if not connected
6468
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/mac_can_pcan_plugin.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ namespace isobus
3434
/// @brief The destructor for MacCANPCANPlugin
3535
virtual ~MacCANPCANPlugin();
3636

37+
/// @brief Returns the displayable name of the plugin
38+
/// @returns MacCAN
39+
std::string get_name() const override;
40+
3741
/// @brief Returns if the connection with the hardware is valid
3842
/// @returns `true` if connected, `false` if not connected
3943
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/mcp2515_can_interface.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ namespace isobus
3939
/// @brief The destructor for SocketCANInterface
4040
virtual ~MCP2515CANInterface();
4141

42+
/// @brief Returns the displayable name of the plugin
43+
/// @returns MCP2515
44+
std::string get_name() const override;
45+
4246
/// @brief Returns if the socket connection is valid
4347
/// @returns `true` if connected, `false` if not connected
4448
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/ntcan_plugin.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ namespace isobus
3030
/// @param[in] baudrate The baudrate to use for the CAN connection.
3131
explicit NTCANPlugin(int channel, int baudrate = NTCAN_BAUD_250);
3232

33+
/// @brief Returns the displayable name of the plugin
34+
/// @returns ESD NTCAN
35+
std::string get_name() const override;
36+
3337
/// @brief The destructor for NTCANPlugin
3438
virtual ~NTCANPlugin() = default;
3539

hardware_integration/include/isobus/hardware_integration/pcan_basic_windows_plugin.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ namespace isobus
3939
/// @brief The destructor for PCANBasicWindowsPlugin
4040
virtual ~PCANBasicWindowsPlugin();
4141

42+
/// @brief Returns the displayable name of the plugin
43+
/// @returns PEAK CAN
44+
std::string get_name() const override;
45+
4246
/// @brief Returns if the connection with the hardware is valid
4347
/// @returns `true` if connected, `false` if not connected
4448
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/socket_can_interface.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ namespace isobus
3535
/// @brief The destructor for SocketCANInterface
3636
virtual ~SocketCANInterface();
3737

38+
/// @brief Returns the displayable name of the plugin
39+
/// @returns SocketCAN
40+
std::string get_name() const override;
41+
3842
/// @brief Returns if the socket connection is valid
3943
/// @returns `true` if connected, `false` if not connected
4044
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/sys_tec_windows_plugin.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ namespace isobus
4141
/// @brief The destructor for PCANBasicWindowsPlugin
4242
virtual ~SysTecWindowsPlugin();
4343

44+
/// @brief Returns the displayable name of the plugin
45+
/// @returns SYS TEC
46+
std::string get_name() const override;
47+
4448
/// @brief Returns if the connection with the hardware is valid
4549
/// @returns `true` if connected, `false` if not connected
4650
bool get_is_valid() const override;

hardware_integration/include/isobus/hardware_integration/toucan_vscp_canal.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ namespace isobus
4343
/// @brief The destructor for TouCANPlugin
4444
virtual ~TouCANPlugin();
4545

46+
/// @brief Returns the displayable name of the plugin
47+
/// @returns Rusoku TouCAN
48+
std::string get_name() const override;
49+
4650
/// @brief Returns if the connection with the hardware is valid
4751
/// @returns `true` if connected, `false` if not connected
4852
bool get_is_valid() const override;

0 commit comments

Comments
 (0)