Kvaser Linux CANLIB

Object Buffers

CANLIB supports object buffers for special purposes. You don't need these object buffers when transmitting and receiving regular messages. Instead, the object buffers allows you to

  • define auto response messages; that is, when a message meeting a certain condition is received, CANLIB will respond automatically with a message you define,
  • define auto transmit messages; that is, messages that are transmitted periodically.

The object buffers are implemented by the firmware and hardware of certain devices, e.g. the Kvaser Leaf Professional. The number of buffers in a device is limited. Typically around 10 buffers are available.

Using the object buffers
To use the object buffers, you start with allocating a buffer with a call to canObjBufAllocate(). For an auto response buffer, you define which messages to respond to by calling canObjBufSetFilter(), and the contents of the response is set with canObjBufWrite().

To enable a buffer, call canObjBufEnable(), and call canObjBufDisable() to disable it.

For an auto transmit buffer, call canObjBufSetPeriod() to set the frequency of the message, call canObjBufSetMsgCount() to set the number of messages to send from the buffer, and call canObjBufWrite() to define the contents of the message.

If you want to send a burst of messages at the highest possible pace, use canObjBufSendBurst().

You deallocate a buffer that you don't want to use any longer by a call to canObjBufFree(). You can deallocate all buffers in one call with canObjBufFreeAll().

See also:
canObjBufFreeAll()
canObjBufAllocate()
canObjBufFree()
canObjBufWrite()
canObjBufSetFilter()
canObjBufSetFlags()
canObjBufEnable()
canObjBufDisable()
canObjBufSendBurst()
canObjBufSetPeriod()
canObjBufSetMsgCount()