« Close

Datasheets and User Guides

App Notes

Software & Driver

 

2.5.5 - RegisterDeviceReconnectCallback

Sets a callback that is called by LJM after the device is found to be disconnected (resulting in a read/write error) and the device is then reconnected.

Syntax

typedef void (*LJM_DeviceReconnectCallback)(int);
LJM_ERROR_RETURN LJM_RegisterDeviceReconnectCallback(
                int Handle, 
                LJM_DeviceReconnectCallback Callback)

Parameters

Handle [in]
A device handle. The handle is a connection ID for an active device. Generate a handle with LJM_Open or LJM_OpenS.
Callback [in]
The callback function which will receive the device Handle as a parameter.

Returns

LJM errorcodes or 0 for no error.

Remarks

For more information on device reconnection, see "2.1 - Opening and Closing".

To disable the previous callback for reconnection, pass 0 or NULL as Callback.

LJM_RegisterDeviceReconnectCallback may not be called from within a LJM_DeviceReconnectCallback.