int eth32_set_event_queue_config(eth32 handle, int maxsize, int fullqueue);
This function configures the maximum allowable size and the behavior of the event queue within the API. If a nonzero maximum size is configured for the event queue, the API will queue up all event notifications that arrive from the ETH32, allowing you to retrieve and remove them later using the eth32_dequeue_event function. If the number of events in the queue reaches the maximum size you have defined before your application has a chance to retrieve them, the API will stop adding events to the queue. At that point, either old events will be shifted out to make room for the new, or the new events will be ignored, depending on the behavior you have specified with the fullqueue parameter to this function. The event queue starts out disabled on each connection.
This queue is strictly within the API and calling this function does not modify anything on the ETH32 device itself.
handle - The value returned by the eth32_open function.
maxsize - Specifies the maximum number of events that are allowed to be queued.
fullqueue - When the queue is full and new events come in, this specifies whether the new events should be discarded (QUEUE_DISCARD_NEW) or the oldest event in the queue shifted out and discarded to make room for the new event at the end of the queue (QUEUE_DISCARD_OLD).
This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes.
eth32 handle; int result; // .... Your code that establishes a connection here // Configure the event queue to hold up to 1,000 events. // If the queue is ever full and more events arrive, discard // the new events. result=eth32_set_event_queue_config(handle, 1000, QUEUE_DISCARD_NEW); if(result) { // Handle error }