Class CanUsb

Class Documentation

class CanUsb

Public Types

typedef std::function<void(unsigned int channel, uint32_t id, bool extended, uint8_t dlc, const uint8_t data[8])> Callback

Public Functions

CanUsb(lusb::UsbDevice *dev = NULL)
~CanUsb()
std::string version() const
inline uint16_t versionMajor() const
inline uint16_t versionMinor() const
inline uint16_t versionBuild() const
inline uint16_t versionComms() const
inline uint32_t serialNumber() const
inline MacAddr macAddr() const
inline unsigned int numChannels() const
bool open(const std::string &mac = std::string())
bool isOpen()
void closeDevice()
bool reboot()
bool reset()
bool setBitrate(unsigned int channel, uint32_t bitrate, uint8_t mode = 0)
bool addFilter(unsigned int channel, uint32_t mask, uint32_t match)
bool getStats(std::vector<uint32_t> &rx_drops, std::vector<uint32_t> &tx_drops, std::vector<uint8_t> &rx_errors, std::vector<uint8_t> &tx_errors, bool clear = false)
bool getTimeStamp(uint32_t &timestamp)
void sendMessage(unsigned int channel, uint32_t id, bool extended, uint8_t dlc, const uint8_t data[8], bool flush = true)
void flushMessages()
inline void setRecvCallback(const Callback &callback)

Public Static Attributes

static const int USB_DEFAULT_TIMEOUT = 10
static const unsigned int MAX_CHANNELS = 4
static const unsigned int MAX_FILTERS = 32