IDS peak comfortC v1.14.1
Loading...
Searching...
No Matches

Data Structures

struct  peak_message_queue_statistics_info
 peak queue info struct More...

Typedefs

typedef struct peak_message_queue * peak_message_queue_handle
 peak queue handle The value for an invalid queue handle is PEAK_INVALID_HANDLE.

Enumerations

enum  peak_message_queue_mode { PEAK_QUEUE_MODE_INVALID , PEAK_QUEUE_MODE_OLDEST_FIRST , PEAK_QUEUE_MODE_NEWEST_ONLY }
 peak queue mode Changes the behavior of the queue More...

Functions

peak_status peak_MessageQueue_Create (peak_message_queue_handle *hMessageQueue)
 Creates a new message queue.
peak_status peak_MessageQueue_Destroy (peak_message_queue_handle hMessageQueue)
 Destroy a message queue.
peak_status peak_MessageQueue_EnableMessage (peak_message_queue_handle hMessageQueue, peak_camera_handle hCam, peak_message_type messageType)
 Enable a message type for a message queue.
peak_status peak_MessageQueue_DisableMessage (peak_message_queue_handle hMessageQueue, peak_camera_handle hCam, peak_message_type messageType)
 Disable a message type for a message queue.
peak_status peak_MessageQueue_EnableMessageList (peak_message_queue_handle hMessageQueue, peak_camera_handle hCam, const peak_message_type *messageTypesArray, size_t messageTypesArraySize)
 Enable a list of message types at once.
peak_status peak_MessageQueue_DisableMessageList (peak_message_queue_handle hMessageQueue, peak_camera_handle hCam, const peak_message_type *messageTypesArray, size_t messageTypesArraySize)
 Disable a list of message types at once.
peak_status peak_MessageQueue_EnabledMessages_GetList (peak_message_queue_handle hMessageQueue, peak_message_type *messageTypesArray, size_t *messageTypesArraySize)
 Query the current message types enabled for the queue.
peak_status peak_MessageQueue_SetMode (peak_message_queue_handle hMessageQueue, peak_message_queue_mode queueMode)
 Set the queue mode.
peak_status peak_MessageQueue_GetMode (peak_message_queue_handle hMessageQueue, peak_message_queue_mode *queueMode)
 Get the queue mode.
peak_status peak_MessageQueue_Start (peak_message_queue_handle hMessageQueue)
 Start the queue.
peak_status peak_MessageQueue_Stop (peak_message_queue_handle hMessageQueue)
 Stop the queue.
peak_bool peak_MessageQueue_IsStarted (peak_message_queue_handle hMessageQueue)
 Checks if the queue is started.
peak_status peak_MessageQueue_WaitForMessage (peak_message_queue_handle hMessageQueue, uint32_t timeout_ms, peak_message_handle *hMessage)
 Wait for a new message.
peak_status peak_MessageQueue_Flush (peak_message_queue_handle hMessageQueue)
 Flushes the queue.
peak_bool peak_MessageQueue_IsMessageSupported (peak_message_queue_handle hMessageQueue, peak_camera_handle hCam, peak_message_type messageType)
 Checks if the message type is supported by the queue.
peak_status peak_MessageQueue_Statistics_Get (peak_message_queue_handle hMessageQueue, peak_message_queue_statistics_info *messageQueueInfo)
 Get the queue statistic info.
peak_status peak_MessageQueue_Statistics_Reset (peak_message_queue_handle hMessageQueue)
 Reset the queue statistic info.
peak_status peak_MessageQueue_MaxQueueSize_Set (peak_message_queue_handle hMessageQueue, size_t messageQueueMaxSize)
 Sets the maximum queue size

  • If the queue size is reached and new message are about to be enqueued they will be discarded. The next call to peak_MessageQueue_WaitForMessage returns then with PEAK_STATUS_WARNING_OVERFLOW, the discarded count is incremented. Supply 0 for messageQueueMaxSize to set the default value of 100. The range is limited to [10, 10000].

peak_status peak_MessageQueue_MaxQueueSize_Get (peak_message_queue_handle hMessageQueue, size_t *messageQueueMaxSize)
 Gets the maximum queue size.

Detailed Description

Definitions on the Queue.

Enumeration Type Documentation

◆ peak_message_queue_mode

peak queue mode Changes the behavior of the queue

Enumerator
PEAK_QUEUE_MODE_INVALID 

Invalid queue mode.

PEAK_QUEUE_MODE_OLDEST_FIRST 

Oldest messages returned first (chronological order)

PEAK_QUEUE_MODE_NEWEST_ONLY 

Newest messages returned only (event order)

Function Documentation

◆ peak_MessageQueue_Create()

peak_status peak_MessageQueue_Create ( peak_message_queue_handle * hMessageQueue)

Creates a new message queue.

Parameters
[out]hMessageQueuePointer to a handle for a message queue receiving the instance handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_Destroy()

peak_status peak_MessageQueue_Destroy ( peak_message_queue_handle hMessageQueue)

Destroy a message queue.

After the call the handle is invalid.

Parameters
[in]hMessageQueueHandle for a message queue instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_DisableMessage()

peak_status peak_MessageQueue_DisableMessage ( peak_message_queue_handle hMessageQueue,
peak_camera_handle hCam,
peak_message_type messageType )

Disable a message type for a message queue.

Note the different behavior for the different message type categories for hCam.

For System messages supply PEAK_INVALID_HANDLE as camera handle. For Camera and AutoFeature types supply a valid peak_camera_handle.

Note
Can only be changed if the queue is stopped.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]hCamHandle for a camera instance or PEAK_INVALID_HANDLE for system messages.
[in]messageTypeMessage type to disable.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER hCam is an invalid handle (non-NULL), or messageType is an invalid type.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_DisableMessageList()

peak_status peak_MessageQueue_DisableMessageList ( peak_message_queue_handle hMessageQueue,
peak_camera_handle hCam,
const peak_message_type * messageTypesArray,
size_t messageTypesArraySize )

Disable a list of message types at once.

Note the different behavior for the different message type categories for hCam.

For System messages supply PEAK_INVALID_HANDLE as camera handle. For Camera and AutoFeature types supply a valid peak_camera_handle.

Note
Can only be changed if the queue is stopped.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]hCamHandle for a camera instance or PEAK_INVALID_HANDLE for system messages.
[in]messageTypesArrayArray of message types to disable.
[in]messageTypesArraySizeCount of message types in messageTypesArray.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER hCam is an invalid handle (non-NULL), or element of messageTypesArray is an invalid type.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_EnabledMessages_GetList()

peak_status peak_MessageQueue_EnabledMessages_GetList ( peak_message_queue_handle hMessageQueue,
peak_message_type * messageTypesArray,
size_t * messageTypesArraySize )

Query the current message types enabled for the queue.

Provides the current list of message types enabled for the queue.

This function implements the Two Staged Data Query principle.

Parameters
[in]hMessageQueueHandle for a message queue instance.
[out]messageTypesArrayPointer to a user allocated array buffer to receive the message type list. If this parameter is NULL, messageTypesArraySize will contain the current number of enabled message types.
The needed size of messageTypesArray in bytes is messageTypesArraySize x sizeof(peak_message_type).
[in,out]messageTypesArraySize
  • messageTypesArray equal NULL:
    out: minimal number of message types messageTypesArray must be large enough to hold
  • messageTypesArray unequal NULL:
    in: number of message types messageTypesArray can hold
    out: number of message types filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_BUFFER_TOO_SMALL messageTypesArray is not NULL and the value of *messageTypesArraySize is too small to receive the expected amount of data.
PEAK_STATUS_INVALID_PARAMETER messageTypesArraySize is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
Consider that the list might change between the size query call and the list query call if message types are enabled or disabled between the two calls. To eliminate this issue you may want to use an array for messageTypesArray which is large enough to hold all possibly types and to spare the size query call.
Since
1.5

◆ peak_MessageQueue_EnableMessage()

peak_status peak_MessageQueue_EnableMessage ( peak_message_queue_handle hMessageQueue,
peak_camera_handle hCam,
peak_message_type messageType )

Enable a message type for a message queue.

Note the different behavior for the different message type categories for hCam.

For System messages supply PEAK_INVALID_HANDLE as camera handle. For Camera and AutoFeature types supply a valid peak_camera_handle.

Note
Can only be changed if the queue is stopped.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]hCamHandle for a camera instance or PEAK_INVALID_HANDLE for system messages.
[in]messageTypeMessage type to enable.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER hCam is an invalid handle (non-NULL), or messageType is an invalid type.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_EnableMessageList()

peak_status peak_MessageQueue_EnableMessageList ( peak_message_queue_handle hMessageQueue,
peak_camera_handle hCam,
const peak_message_type * messageTypesArray,
size_t messageTypesArraySize )

Enable a list of message types at once.

Note the different behavior for the different message type categories for hCam.

For System messages supply PEAK_INVALID_HANDLE as camera handle. For Camera and AutoFeature types supply a valid peak_camera_handle.

Note
Can only be changed if the queue is stopped.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]hCamHandle for a camera instance or PEAK_INVALID_HANDLE for system messages.
[in]messageTypesArrayArray of message types to enable.
[in]messageTypesArraySizeCount of message types in messageTypesArray.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER hCam is an invalid handle (non-NULL), or element of messageTypesArray is an invalid type.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_Flush()

peak_status peak_MessageQueue_Flush ( peak_message_queue_handle hMessageQueue)

Flushes the queue.

Only affects message currently in queue. All currently queued messages will be discarded.

Parameters
[in]hMessageQueueHandle for a message queue instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_GetMode()

peak_status peak_MessageQueue_GetMode ( peak_message_queue_handle hMessageQueue,
peak_message_queue_mode * queueMode )

Get the queue mode.

Valid values are PEAK_QUEUE_MODE_OLDEST_FIRST for chronological order or PEAK_QUEUE_MODE_NEWEST_ONLY for event order.

Parameters
[in]hMessageQueueHandle for a message queue instance.
[out]queueModeThe queue mode.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER queueMode is an invalid mode.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_IsMessageSupported()

peak_bool peak_MessageQueue_IsMessageSupported ( peak_message_queue_handle hMessageQueue,
peak_camera_handle hCam,
peak_message_type messageType )

Checks if the message type is supported by the queue.

System events are always supported, but camera events may differ between different models.

Note the different behavior for the different message type categories for hCam.

For Camera and AutoFeature types supply a valid peak_camera_handle.

Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]hCamHandle for a camera instance.
[in]messageTypeThe message type to check the support for.
Returns
PEAK_TRUE Message type is supported.
PEAK_FALSE Message type is not supported or the query failed.
Since
1.5

◆ peak_MessageQueue_IsStarted()

peak_bool peak_MessageQueue_IsStarted ( peak_message_queue_handle hMessageQueue)

Checks if the queue is started.

Checks if the queue is started.

Parameters
[in]hMessageQueueHandle for a message queue instance.
Returns
PEAK_TRUE Queue is started.
PEAK_FALSE Queue is stopped or the query failed.
Since
1.5

◆ peak_MessageQueue_MaxQueueSize_Get()

peak_status peak_MessageQueue_MaxQueueSize_Get ( peak_message_queue_handle hMessageQueue,
size_t * messageQueueMaxSize )

Gets the maximum queue size.

See peak_MessageQueue_MaxQueueSize_Set for more infos.

Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]messageQueueMaxSizeMaximum number of messages in queue.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER messageQueueMaxSize is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_MaxQueueSize_Set()

peak_status peak_MessageQueue_MaxQueueSize_Set ( peak_message_queue_handle hMessageQueue,
size_t messageQueueMaxSize )

Sets the maximum queue size

  • If the queue size is reached and new message are about to be enqueued they will be discarded. The next call to peak_MessageQueue_WaitForMessage returns then with PEAK_STATUS_WARNING_OVERFLOW, the discarded count is incremented. Supply 0 for messageQueueMaxSize to set the default value of 100. The range is limited to [10, 10000].

Note
Can only be changed if the queue is stopped.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]messageQueueMaxSizeMaximum number of messages in queue.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_OUT_OF_RANGE messageQueueMaxSize is out of range.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_SetMode()

peak_status peak_MessageQueue_SetMode ( peak_message_queue_handle hMessageQueue,
peak_message_queue_mode queueMode )

Set the queue mode.

Changes the queue operation mode. Valid values are PEAK_QUEUE_MODE_OLDEST_FIRST for chronological order or PEAK_QUEUE_MODE_NEWEST_ONLY for event order.

Note
Can only be changed if the queue is stopped.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]queueModeThe queue mode to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER queueMode is an invalid mode.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_Start()

peak_status peak_MessageQueue_Start ( peak_message_queue_handle hMessageQueue)

Start the queue.

Starts the queue. This call should be followed by a call to peak_MessageQueue_WaitForMessage.

Parameters
[in]hMessageQueueHandle for a message queue instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_Statistics_Get()

peak_status peak_MessageQueue_Statistics_Get ( peak_message_queue_handle hMessageQueue,
peak_message_queue_statistics_info * messageQueueInfo )

Get the queue statistic info.

See peak_message_queue_statistics_info for the struct members.

Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]messageQueueInfoThe message queue statistics info.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_INVALID_PARAMETER messageQueueInfo is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_Statistics_Reset()

peak_status peak_MessageQueue_Statistics_Reset ( peak_message_queue_handle hMessageQueue)

Reset the queue statistic info.

All counters will be cleared.

Parameters
[in]hMessageQueueHandle for a message queue instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_Stop()

peak_status peak_MessageQueue_Stop ( peak_message_queue_handle hMessageQueue)

Stop the queue.

Stops the queue. A waiting call in peak_MessageQueue_WaitForMessage will be triggered and will return with PEAK_STATUS_ABORTED.

Note
The queue will be flushed automatically with this call. All messages will be discarded.
Parameters
[in]hMessageQueueHandle for a message queue instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is not stopped.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5

◆ peak_MessageQueue_WaitForMessage()

peak_status peak_MessageQueue_WaitForMessage ( peak_message_queue_handle hMessageQueue,
uint32_t timeout_ms,
peak_message_handle * hMessage )

Wait for a new message.

A waiting call can be aborted by calling peak_MessageQueue_Stop.

The function may return with PEAK_STATUS_WARNING_OVERFLOW. It indicates an overflow of the queue and messages were discarded. It is advisable to increase the call frequency to peak_MessageQueue_WaitForMessage, increase the queue size or decrease the message frequency.

Note
After processing the message, it must be freed by a call to peak_Message_Release.
Parameters
[in]hMessageQueueHandle for a message queue instance.
[in]timeout_msThe wait timeout in milliseconds. PEAK_INFINITE for infinite.
[out]hMessagePointer to a message handle receiving the message instance.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_WARNING_OVERFLOW Operation was successful; messages were dropped because the queue is overflowing.
PEAK_STATUS_INVALID_HANDLE hMessageQueue is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ACCESS_DENIED The queue is stopped.
PEAK_STATUS_ABORTED The queue was stopped while waiting.
PEAK_STATUS_NO_DATA No data received.
PEAK_STATUS_TIMEOUT The timeout was reached with no message.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.5