icsneo_enableMessagePolling

Function icsneo_enableMessagePolling 

Source
pub unsafe extern "C" fn icsneo_enableMessagePolling(
    device: *const neodevice_t,
) -> bool
Expand description

\brief Enable buffering of messages for the specified hardware \param[in] device A pointer to the neodevice_t structure specifying the device to operate on. \returns True if polling could be enabled.

By default, traffic the device receives will not reach the client application. The client application must register traffic handlers, enable message polling, or both. This function addresses message polling.

With polling enabled, all traffic that the device receives will be stored in a buffer managed by the API. The client application should then call icsneo_getMessages() periodically to take ownership of the messages in that buffer.

The API managed buffer will only grow to a specified size, 20k messages by default. See icsneo_getPollingMessageLimit() and icsneo_setPollingMessageLimit() for more information.

In high traffic situations, the default 20k message limit can be reached very quickly. The client application will have to call icsneo_getMessages() very often to avoid losing messages, or change the limit.

If the message limit is exceeded before a call to icsneo_getMessages() takes ownership of the messages, the oldest message will be dropped (LOST) and an icsneo::APIEvent::PollingMessageOverflow will be flagged for the device.

This function will succeed even if the device is not open.