18 baudrateConstant(baudrate),
21 if (channel > USBCAN_CHANNEL_CH1)
23 LOG_CRITICAL(
"[SYSTEC]: Invalid channel");
28 serialNumber(serialNumber),
29 baudrateConstant(baudrate)
49 UcanDeinitHardware(
handle);
50 handle = USBCAN_INVALID_HANDLE;
69 tUcanInitCanParam initCANParameters = { 0 };
70 tUcanChannelInfo channelInfo = { 0 };
71 channelInfo.m_dwSize =
sizeof(tUcanChannelInfo);
73 initCANParameters.m_dwSize =
sizeof(tUcanInitCanParam);
74 initCANParameters.m_bMode = kUcanModeNormal;
77 initCANParameters.m_bOCR = 0x1A;
78 initCANParameters.m_dwAMR = USBCAN_AMR_ALL;
79 initCANParameters.m_dwACR = USBCAN_ACR_ALL;
80 initCANParameters.m_dwBaudrate = USBCAN_BAUDEX_USE_BTR01;
81 initCANParameters.m_wNrOfRxBufferEntries = USBCAN_DEFAULT_BUFFER_ENTRIES;
82 initCANParameters.m_wNrOfTxBufferEntries = USBCAN_DEFAULT_BUFFER_ENTRIES;
88 LOG_CRITICAL(
"[SYSTEC]: Error trying to configure a SYS TEC probe channel");
93 LOG_CRITICAL(
"[SYSTEC]: Error trying to connect to SYS TEC probe");
98 LOG_WARNING(
"[SYSTEC]: CAN Adapter already initialized.");
130 std::this_thread::sleep_for(std::chrono::milliseconds(1));
A class that acts as a logging sink. The intent is that someone could make their own derived class of...
A CAN frame for interfacing with a hardware layer, like socket CAN or other interface.
std::uint8_t dataLength
The length of the data used in the frame.
std::uint32_t identifier
The 32 bit identifier of the frame.
bool isExtendedFrame
Denotes if the frame is extended format.
std::uint8_t data[8]
The data payload of the frame.
A class that represents a generic CAN message of arbitrary length.
SysTecWindowsPlugin(std::uint8_t channel=USBCAN_CHANNEL_CH0, std::uint32_t baudrate=USBCAN_BAUD_250kBit)
Constructor for the Windows SYS TEC plugin.
virtual ~SysTecWindowsPlugin()
The destructor for PCANBasicWindowsPlugin.
std::uint32_t serialNumber
The serial number to connect to, or 0 if not used.
std::uint16_t baudrateConstant
The constant used to configure the adapter's baudrate.
bool write_frame(const isobus::CANMessageFrame &canFrame) override
Writes a frame to the bus (synchronous)
void open() override
Connects to the hardware you specified in the constructor's channel argument.
std::uint8_t handle
The handle for the device, used to interact with the DLL.
bool read_frame(isobus::CANMessageFrame &canFrame) override
Returns a frame from the hardware (synchronous), or false if no frame can be read.
bool openResult
Stores the result of the call to begin CAN communication. Used for is_valid check later.
void close() override
Closes the connection to the hardware.
std::uint8_t channelIndex
The channel for the device, used if you have a multi-channel device.
bool get_is_valid() const override
Returns if the connection with the hardware is valid.
This namespace encompasses all of the ISO11783 stack's functionality to reduce global namespace pollu...
An interface for using a SYS TEC sysWORXX USB CAN device.