Functions
Object buffers
CANlib

Used for auto transmit and auto response messages. More...

## Functions
canStatus | canObjBufFreeAll (const CanHandle hnd)
canStatus | canObjBufAllocate (const CanHandle hnd, int type)
canStatus | canObjBufFree (const CanHandle hnd, int idx)
canStatus | canObjBufWrite (const CanHandle hnd, int idx, int id, void *msg, unsigned int dlc, unsigned int flags)
canStatus | canObjBufSetFilter (const CanHandle hnd, int idx, unsigned int code, unsigned int mask)
canStatus | canObjBufSetFlags (const CanHandle hnd, int idx, unsigned int flags)
canStatus | canObjBufSetPeriod (const CanHandle hnd, int idx, unsigned int period)
canStatus | canObjBufSetMsgCount (const CanHandle hnd, int idx, unsigned int count)
canStatus | canObjBufEnable (const CanHandle hnd, int idx)
canStatus | canObjBufDisable (const CanHandle hnd, int idx)
canStatus | canObjBufSendBurst (const CanHandle hnd, int idx, unsigned int burstlen)

## Detailed Description

Used for auto transmit and auto response messages.

## Function Documentation

## ◆ canObjBufAllocate()

canStatus canObjBufAllocate | ( | const CanHandle | hnd,
|  | int | type
| ) |  |

Allocates an object buffer associated with a handle to a CAN circuit.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | type | The type of the buffer. Must be one of canOBJBUF_TYPE_xxx

Returns
  A buffer index (zero or positive) if success.
  canERR_xxx (negative) if failure

See also
  Object Buffers
  canObjBufFree(), canObjBufFreeAll()

## ◆ canObjBufDisable()

canStatus canObjBufDisable | ( | const CanHandle | hnd,
|  | int | idx
| ) |  |

Disables the object buffer with the specified index.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | idx | The index of the buffer.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers
  canObjBufEnable()

## ◆ canObjBufEnable()

canStatus canObjBufEnable | ( | const CanHandle | hnd,
|  | int | idx
| ) |  |

Enables the object buffer with the specified index.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | idx | The index of the object buffer to enable.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers
  canObjBufDisable()

## ◆ canObjBufFree()

canStatus canObjBufFree | ( | const CanHandle | hnd,
|  | int | idx
| ) |  |

Deallocates the object buffer with the specified index. The buffer can not be referenced after this operation.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | idx | The object buffer to deallocate.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers
  canObjBufFreeAll(), canObjBufAllocate(),

## ◆ canObjBufFreeAll()

canStatus canObjBufFreeAll | ( | const CanHandle | hnd | ) |

Deallocates all object buffers on the specified handle. The buffers cannot be referenced after this operation.

Parameters

  [in] | hnd | An open handle to a CAN circuit.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers
  canObjBufFree(), canObjBufAllocate()

## ◆ canObjBufSendBurst()

canStatus canObjBufSendBurst | ( | const CanHandle | hnd,
|  | int | idx,
|  | unsigned int | burstlen
| ) |  |

The canObjBufSendBurst function sends a burst of CAN messages. You have to set up an object buffer first with the message to send. The messages will be sent as fast as possible from the hardware.

This function is inteneded for certain diagnostic applications.

Parameters

  [in] | hnd | An open handle to a CAN channel.
  [in] | idx | The index of a CAN object buffer.
  [in] | burstlen | The number of messages to send.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers

## ◆ canObjBufSetFilter()

canStatus canObjBufSetFilter | ( | const CanHandle | hnd,
|  | int | idx,
|  | unsigned int | code,
|  | unsigned int | mask
| ) |  |

Defines a message reception filter on the specified object buffer. Messages not matching the filter are discarded.

Note
  For an auto response buffer, set the code and mask that together define the identifier(s) that trigger(s) the automatic response.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | idx | The index of the object buffer on which the filter is to be set.
  [in] | code | The acceptance code in the filter.
  [in] | mask | The acceptance mask in the filter.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Code and Mask Format, Object Buffers

## ◆ canObjBufSetFlags()

canStatus canObjBufSetFlags | ( | const CanHandle | hnd,
|  | int | idx,
|  | unsigned int | flags
| ) |  |

Sets object buffer flags on a specified object buffer.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | idx | The buffer on which the flags are to be set.
  [in] | flags | Specifies a combination of zero or more of the canOBJBUF_AUTO_RESPONSE_xxx flag values

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers

## ◆ canObjBufSetMsgCount()

canStatus canObjBufSetMsgCount | ( | const CanHandle | hnd,
|  | int | idx,
|  | unsigned int | count
| ) |  |

The canObjBufSetMsgCount function sets the message count for an auto transmit object buffer.

Parameters

  [in] | hnd | An open handle to a CAN channel.
  [in] | idx | The index of a CAN object buffer.
  [in] | count | The message count.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers

## ◆ canObjBufSetPeriod()

canStatus canObjBufSetPeriod | ( | const CanHandle | hnd,
|  | int | idx,
|  | unsigned int | period
| ) |  |

The canObjBufSetPeriod function sets the transmission period for an auto transmission object buffer.

Parameters

  [in] | hnd | An open handle to a CAN channel.
  [in] | idx | The index of a CAN object buffer.
  [in] | period | The transmission interval, in microseconds.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers

## ◆ canObjBufWrite()

canStatus canObjBufWrite | ( | const CanHandle | hnd,
|  | int | idx,
|  | int | id,
|  | void * | msg,
|  | unsigned int | dlc,
|  | unsigned int | flags
| ) |  |

Defines the contents of a specific object buffer.

Parameters

  [in] | hnd | An open handle to a CAN circuit.
  [in] | idx | The index of the object buffer whose contents is to be defined.
  [in] | id | The CAN identifier of the message.
  [in] | msg | Points to the contents of the message.
  [in] | dlc | The length of the message in bytes. For Classic CAN dlc can be at most 8, unless canOPEN_ACCEPT_LARGE_DLC is used. For CAN FD dlc can be one of the following 0-8, 12, 16, 20, 24, 32, 48, 64.
  [in] | flags | Message flags; a combination of the canMSG_xxx flags.

Returns
  canOK (zero) if success
  canERR_xxx (negative) if failure

See also
  Object Buffers