23 #ifndef _icl_hardware_can_tCanDeviceT_hpp_ 24 #define _icl_hardware_can_tCanDeviceT_hpp_ 30 #ifndef _SYSTEM_WIN32_ 38 #undef ICL_CORE_LOCAL_LOGGING 45 template <
typename TCanDescriptor>
47 unsigned char acceptance_code,
unsigned char acceptance_mask,
unsigned int baud_rate,
48 unsigned send_fifo_size,
unsigned receive_fifo_size)
57 const char *convert_string = device_name + strlen(device_name) - 1;
58 m_can_device = (TCanDescriptor)strtol(convert_string, &check_pointer, 10);
59 if (check_pointer == convert_string)
83 m_can_device =
CanDeviceOpen(device_name, flags, acceptance_code, acceptance_mask, baud_rate, send_fifo_size, receive_fifo_size);
100 template <
typename TCanDescriptor>
118 template <
typename TCanDescriptor>
124 if (!icl_core::os::IsThisLxrtTask())
138 template <
typename TCanDescriptor>
144 if (!icl_core::os::IsThisLxrtTask())
158 template <
typename TCanDescriptor>
164 if (!icl_core::os::IsThisLxrtTask()) {
178 template <
typename TCanDescriptor>
int CanDeviceClose(tCanDescriptor)
int CanFifoReceive(int device_id, int user, tCanMessage *msg)
Receive a message via CAN-FIFO.
Implements a struct representing a can message.
int DestroyCanFifoUser(int device_id, int user_id)
Destroys a can FIFO in kernel space.
int CreateCanFifoUser(int device_id, unsigned acceptance_code, unsigned acceptance_mask, unsigned int baud_rate, unsigned send_fifo_size, unsigned receive_fifo_size)
Creates a can FIFO in kernel space.
int CanFifoSend(int device_id, const tCanMessage *msg)
Send a message via CAN-FIFO.
tCanDeviceT(const char *device_name, int flags, unsigned char acceptance_code, unsigned char acceptance_mask, unsigned int baud_rate, unsigned send_fifo_size, unsigned receive_fifo_size)
TCanDescriptor m_can_device
bool CanDescriptorValid(tCanDescriptor can_device)
static bool m_canlxrt_available
#define LOGGING_ERROR_CO(stream, classname, objectname, arg)
int CanFifoReset(int device_id)
Reset a CAN-device.
int CanDeviceReset(tCanDescriptor)
unsigned __int64 uint64_t
bool CanDriverLxrtSupport()
no support for LXRT available
const char * CanDriverName()
ThreadStream & endl(ThreadStream &stream)
tCanDescriptor InvalidCanDescriptor()
virtual int Send(const tCanMessage &msg)
virtual bool IsInitialized()
#define LOGGING_INFO_CO(stream, classname, objectname, arg)
tCanDescriptor CanDeviceOpen(const char *, int, unsigned char, unsigned char, unsigned int, unsigned, unsigned)
Open a can device and set parameters.
int CanDeviceSend(tCanDescriptor, const tCanMessage &)
virtual int Receive(tCanMessage &msg)
int CanDeviceReceive(tCanDescriptor, tCanMessage &)