IDS peak comfortC v1.8.0
Loading...
Searching...
No Matches
Reconnect

Data Structures

struct  peak_reconnect_information
 peak information whether reconnect is successful, the acquisition is running and the configuration is restored More...
 

Functions

peak_status peak_Reconnect_Enable (peak_interface_technology interfaceTech, peak_bool enabled)
 Control whether the reconnect is enabled or disabled.
 
peak_bool peak_Reconnect_IsEnabled (peak_interface_technology interfaceTech)
 Indicates whether the reconnect is active or inactive for the specified specified interface technology.
 
peak_access_status peak_Reconnect_GetAccessStatus (peak_interface_technology interfaceTech)
 Query the reconnect access status.
 

Detailed Description

The reconnect can be enabled or disabled for the specified interface technology. When the reconnect is activated, the camera automatically performs a reconnect if the physical connection is lost and restored. With an enabled reconnect the device will automatically be reopened and restored to its previous state.

If the reconnect is active, additional messages are signaled. 'DeviceDisconnected' will be signaled when a physical connection loss is detected. The signal 'DeviceReconnected' will be sent when the camera reconnect is done. A 'DeviceLost' signal will be sent immediately when the reconnect is not active and a device is removed. When the reconnect is active and a disconnected device will be closed a 'DeviceLost' signal will occur.

Note
Please keep in mind that the behaviour of the signals 'DeviceLost', 'DeviceDisconnected' changes whether the reconnect is active or inactive.
Restoring the device configuration is currently not supported.

Example to enable the reconnect for all supported interface technologies:

for (size_t i = 0; i < sizeof(interface_technologies) / sizeof(peak_interface_technology); i++)
{
peak_access_status access_status = peak_Reconnect_GetAccessStatus(interface_technologies[i]);
peak_bool current_state = PEAK_FALSE;
if (PEAK_IS_WRITEABLE(access_status))
{
peak_status enable_status = peak_Reconnect_Enable(interface_technologies[i], PEAK_TRUE);
if (enable_status != PEAK_STATUS_SUCCESS)
{
// reconnect is enabled
}
}
else if (PEAK_IS_READABLE(access_status))
{
current_state = peak_Reconnect_IsEnabled(interface_technologies[i]);
}
else
{
// the feature is not available
}
if (current_state == PEAK_FALSE)
{
// reconnect not supported
}
}
#define PEAK_FALSE
peak Boolean value for 'false' or 'no'
Definition ids_peak_comfort_c.h:761
#define PEAK_TRUE
peak Boolean value for 'true' or 'yes'
Definition ids_peak_comfort_c.h:752
uint8_t peak_bool
peak Boolean type
Definition ids_peak_comfort_c.h:743
peak_access_status peak_Reconnect_GetAccessStatus(peak_interface_technology interfaceTech)
Query the reconnect access status.
peak_bool peak_Reconnect_IsEnabled(peak_interface_technology interfaceTech)
Indicates whether the reconnect is active or inactive for the specified specified interface technolog...
peak_status peak_Reconnect_Enable(peak_interface_technology interfaceTech, peak_bool enabled)
Control whether the reconnect is enabled or disabled.
#define PEAK_IS_READABLE(accessStatus)
Check for the access status code to indicate read access to be possible.
Definition ids_peak_comfort_c.h:1137
#define PEAK_IS_WRITEABLE(accessStatus)
Check for the access status code to indicate write access to be possible.
Definition ids_peak_comfort_c.h:1121
peak_status
peak Status codes
Definition ids_peak_comfort_c.h:919
peak_access_status
peak Access status codes
Definition ids_peak_comfort_c.h:1056
@ PEAK_STATUS_SUCCESS
Success.
Definition ids_peak_comfort_c.h:921
peak_interface_technology
peak interface technology
Definition ids_peak_comfort_c.h:1160
@ peak_interface_technology_GEV
GigE vision interface technology.
Definition ids_peak_comfort_c.h:1167
@ peak_interface_technology_UEYE
uEye interface technology
Definition ids_peak_comfort_c.h:1171
@ peak_interface_technology_U3V
USB3 vision interface technology.
Definition ids_peak_comfort_c.h:1169

Example to use the reconnect and disconnect message

...
// Wait for messages and retrieve data message type
...
{
peak_Message_Data_DeviceReconnected_Get(hMessage, &reconnectedData);
...
}
else if (messageType == PEAK_MESSAGE_TYPE_DEVICE_DISCONNECTED)
{
peak_Message_Data_DeviceDisconnected_Get(hMessage, &disconnectedData);
...
}
peak_status peak_Message_Data_DeviceReconnected_Get(peak_message_handle hMessage, peak_message_data_device_reconnected *message)
Get the message data for camera manager device reconnected data types.
peak_status peak_Message_Data_DeviceDisconnected_Get(peak_message_handle hMessage, peak_message_data_device_disconnected *message)
Get the message data for camera manager device disconnected data types.
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_MESSAGE_TYPE_DEVICE_DISCONNECTED
Camera manager device disconnected message type.
Definition ids_peak_comfort_c.h:12053
@ PEAK_MESSAGE_TYPE_DEVICE_RECONNECTED
Camera manager device reconnected message type.
Definition ids_peak_comfort_c.h:12048
peak message data for camera manager device disconnected messages.
Definition ids_peak_comfort_c.h:12302
peak message data for camera manager device reconnected messages.
Definition ids_peak_comfort_c.h:12285

Function Documentation

◆ peak_Reconnect_Enable()

peak_status peak_Reconnect_Enable ( peak_interface_technology  interfaceTech,
peak_bool  enabled 
)

Control whether the reconnect is enabled or disabled.

Sets the reconnect active or inactive.

// enable reconnect for the interface technology GEV
Parameters
[in]interfaceTechinterface technology to which the setting refers.
[in]enabledThe desired enabled status. PEAK_TRUE for enabled, PEAK_FALSE for disabled.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The reconnect info feature is not accessible for read. Check the access status via peak_Reconnect_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER interfaceTech is an invalid interface technology.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Reconnect_GetAccessStatus()

peak_access_status peak_Reconnect_GetAccessStatus ( peak_interface_technology  interfaceTech)

Query the reconnect access status.

// retrieve the access status for the GEV interface technology
const PEAK_API_ACCESS_STATUS access_status = peak_Reconnect_GetAccessStatus(peak_interface_technology_GEV);
if (PEAK_IS_READABLE(access_status)) {
...
}

Provides the current access status for the reconnect feature which is specified by its interface technology.

This function implements the Access Status Query principle.

Parameters
[in]interfaceTechinterface technology to which the setting refers.
Returns
PEAK_ACCESS_READWRITE The feature is available for read access and for write access.
PEAK_ACCESS_READONLY The feature is supported but not available for change.
PEAK_ACCESS_NOT_SUPPORTED The feature is not supported.
PEAK_ACCESS_NONE The feature is not available.
PEAK_ACCESS_INVALID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:

◆ peak_Reconnect_IsEnabled()

peak_bool peak_Reconnect_IsEnabled ( peak_interface_technology  interfaceTech)

Indicates whether the reconnect is active or inactive for the specified specified interface technology.

// check if the reconnect is active for the GEV interface technology
Parameters
[in]interfaceTechinterface technology to which the setting refers.
Returns
PEAK_TRUE The reconnect feature is currently enabled.
PEAK_FALSE The reconnect feature is currently disabled or the query failed.