IDS peak comfortC  v1.6.0
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. More...
 
peak_bool peak_Reconnect_IsEnabled (peak_interface_technology interfaceTech)
 Indicates whether the reconnect is active or inactive for the specified specified interface technology. More...
 
peak_access_status peak_Reconnect_GetAccessStatus (peak_interface_technology interfaceTech)
 Query the reconnect access status. More...
 

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
}
}

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);
...
}

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.