BM_ReadMultipleCanMessage

Function BM_ReadMultipleCanMessage 

Source
pub unsafe extern "C" fn BM_ReadMultipleCanMessage(
    channel_handle: *const c_void,
    msgs: *mut BMCanMessage,
    n_messages: *mut c_int,
    timeout: c_int,
    channels: *mut c_int,
    timestamps: *mut c_int,
) -> BMStatus
Expand description

Read multiple CAN messages out of the given channel. This function is non-blocked, and thus will return BMStatus::ReceiveBufferEmpty if not all messages are received. Please use notifications to wait for RX events and then read message/event out of BM API internal RX buffer, otherwise you could also poll the device periodically.

ยงArguments

  • channel_handle: Handle to the channel to read from.
  • msgs: A caller-allocated buffer to hold the CAN message array output, see BMCanMessage for details.
  • n_messages: Number of read messages, user shall initialize this param with the size (in messages) of the data buffer.
  • timeout: Timeout (in milliseconds) before the message is received successfully from the bus. Set any negative number (i.e. -1) to wait infinitely. Set 0 if you would like to receive asynchronously: read from BM API internal buffer and return immediately, use BM_WaitForNotifications before reading.
  • channels: The source channel ID from which the message is received, starting from zero, could be NULL if not required.
  • timestamps: The device local high precision timestamp array in microseconds, when the message is physically transmitted on the CAN bus, could be NULL if not required.

returns: BMStatus