Profishark API 2.6.1.0
Loading...
Searching...
No Matches
Callbacks

Callback mechanism. More...

Data Structures

struct  ProfisharkApiCallbackValue_DiskDump
 A structure describing the event passed to a ProfisharkApiDeviceCallbackType_DiskDump callback. More...
struct  ProfisharkApiCallbackValue_DiskDumpNewFile
 A structure describing the event passed to a ProfisharkApiDeviceCallbackType_DiskDumpNewFile callback. More...
struct  ProfisharkApiCallbackValue_LinkStatus
 A structure describing the event passed to a ProfisharkApiDeviceCallbackType_LinkStatus callback. More...

Typedefs

typedef enum ProfisharkApiGlobalCallbackType ProfisharkApiGlobalCallbackType
 Global callback types.
typedef enum ProfisharkApiDeviceCallbackType ProfisharkApiDeviceCallbackType
 Device specific callback types.
typedef void * ProfisharkApiCallbackValue
 Profishark callback value.
typedef void(* ProfisharkApiCallback) (ProfisharkApiDeviceHandle, void *)
 Callback function.
typedef void(* ProfisharkApiCallbackExt) (ProfisharkApiDeviceHandle, ProfisharkApiCallbackValue *, void *)
 Callback function.
typedef struct ProfisharkApiCallbackValue_DiskDump ProfisharkApiCallbackValue_DiskDump
 A structure describing the event passed to a ProfisharkApiDeviceCallbackType_DiskDump callback.
typedef struct ProfisharkApiCallbackValue_DiskDumpNewFile ProfisharkApiCallbackValue_DiskDumpNewFile
 A structure describing the event passed to a ProfisharkApiDeviceCallbackType_DiskDumpNewFile callback.
typedef struct ProfisharkApiCallbackValue_LinkStatus ProfisharkApiCallbackValue_LinkStatus
 A structure describing the event passed to a ProfisharkApiDeviceCallbackType_LinkStatus callback.

Enumerations

enum  ProfisharkApiGlobalCallbackType { ProfisharkApiGlobalCallbackType_NewDevice , ProfisharkApiGlobalCallbackType_DeviceRemoved }
 Global callback types. More...
enum  ProfisharkApiDeviceCallbackType { ProfisharkApiDeviceCallbackType_DiskDump , ProfisharkApiDeviceCallbackType_DiskDumpNewFile , ProfisharkApiDeviceCallbackType_LinkStatus }
 Device specific callback types. More...

Functions

PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIAddNewDeviceCallback (ProfisharkApiCallback callback, void *context)
 Add a new function to be called when a new Profishark device is detected.
PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIRemoveNewDeviceCallback (ProfisharkApiCallback callback)
 Remove a function from the list of functions called when a new Profishark device is detected.
PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIAddDeviceGoneCallback (ProfisharkApiCallback callback, void *context)
 Add a new function to be called when a Profishark device is disconnected.
PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIRemoveDeviceGoneCallback (ProfisharkApiCallback callback)
 Remove a function from the list of functions called when a new Profishark device is disconnected.
PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIAddGlobalCallback (ProfisharkApiGlobalCallbackType type, ProfisharkApiCallbackExt callback, void *context)
 Add a global callback function.
PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIAddDeviceCallback (ProfisharkApiDeviceHandle handle, ProfisharkApiDeviceCallbackType type, ProfisharkApiCallbackExt callback, void *context)
 Add a device callback function.
PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIRemoveGlobalCallback (ProfisharkApiGlobalCallbackType type, ProfisharkApiCallbackExt callback)
 Remove a global callback function.
PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIRemoveDeviceCallback (ProfisharkApiDeviceHandle handle, ProfisharkApiDeviceCallbackType type, ProfisharkApiCallbackExt callback)
 Remove a device callback function.

Detailed Description

Callback mechanism.

Typedef Documentation

◆ ProfisharkApiCallback

typedef void(* ProfisharkApiCallback) (ProfisharkApiDeviceHandle, void *)

Callback function.

Parameters
handlea Profishark device handle
contexta user defined value
Deprecated
Functions using this type are deprecated. See ProfisharkApiCallbackExt.

◆ ProfisharkApiCallbackExt

typedef void(* ProfisharkApiCallbackExt) (ProfisharkApiDeviceHandle, ProfisharkApiCallbackValue *, void *)

Callback function.

Parameters
handlea Profishark device handle
valuea value passed to the callback. To use it, the user has to cast it to the appropriate type depending on the callback type. See ProfisharkApiGlobalCallbackType and ProfisharkApiDeviceCallbackType
contexta user defined value

◆ ProfisharkApiCallbackValue

Profishark callback value.

Opaque type used by callback functions. To be used, this needs to be cast to the proper type depending on the callback type

Enumeration Type Documentation

◆ ProfisharkApiDeviceCallbackType

Device specific callback types.

Enumerator
ProfisharkApiDeviceCallbackType_DiskDump 

Function is called on direct capture events (capture start, capture stop). ProfisharkApiCallbackValue is to be cast as ProfisharkApiCallbackValue_DiskDump

ProfisharkApiDeviceCallbackType_DiskDumpNewFile 

Function is called when a new file has been created by direct capture. ProfisharkApiCallbackValue is to be cast as ProfisharkApiCallbackValue_DiskDumpNewFile

ProfisharkApiDeviceCallbackType_LinkStatus 

Function is called when one of the ethernet links status has changed. ProfisharkApiCallbackValue is to be cast as ProfisharkApiCallbackValue_LinkStatus

◆ ProfisharkApiGlobalCallbackType

Global callback types.

Enumerator
ProfisharkApiGlobalCallbackType_NewDevice 

Function is called on device insertion. ProfisharkApiCallbackValue is not used

ProfisharkApiGlobalCallbackType_DeviceRemoved 

Function is called on device removal. ProfisharkApiCallbackValue is not used

Function Documentation

◆ ProfisharkAPIAddDeviceCallback()

PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIAddDeviceCallback ( ProfisharkApiDeviceHandle handle,
ProfisharkApiDeviceCallbackType type,
ProfisharkApiCallbackExt callback,
void * context )

Add a device callback function.

Parameters
handlea handle to the device
typethe type of callback to add. This defines when the function is called.
callbackthe function to be called
contexta pointer passed to the callback function
Return values
ProfisharkAPIRet_Successon success

◆ ProfisharkAPIAddDeviceGoneCallback()

PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIAddDeviceGoneCallback ( ProfisharkApiCallback callback,
void * context )

Add a new function to be called when a Profishark device is disconnected.

Parameters
callbackthe function to be called
contextthe parameter passed to the function to be called
Return values
ProfisharkAPIRet_Successon success
ProfisharkAPIRet_Existif the function is already registered
Deprecated
Deprecated, use ProfisharkAPIAddGlobalCallback

◆ ProfisharkAPIAddGlobalCallback()

PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIAddGlobalCallback ( ProfisharkApiGlobalCallbackType type,
ProfisharkApiCallbackExt callback,
void * context )

Add a global callback function.

Parameters
typethe type of callback to add. This defines when the function is called.
callbackthe function to be called
contexta pointer passed to the callback function
Return values
ProfisharkAPIRet_Successon success

◆ ProfisharkAPIAddNewDeviceCallback()

PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIAddNewDeviceCallback ( ProfisharkApiCallback callback,
void * context )

Add a new function to be called when a new Profishark device is detected.

Parameters
callbackthe function to be called
contextthe parameter passed to the function to be called
Return values
ProfisharkAPIRet_Successon success
ProfisharkAPIRet_Existif the function is already registered
Deprecated
Deprecated, use ProfisharkAPIAddGlobalCallback

◆ ProfisharkAPIRemoveDeviceCallback()

PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIRemoveDeviceCallback ( ProfisharkApiDeviceHandle handle,
ProfisharkApiDeviceCallbackType type,
ProfisharkApiCallbackExt callback )

Remove a device callback function.

Parameters
handlea handle to the device
typethe type of callback to remove. Must be the same as the one used for the ProfisharkAPIAddDeviceCallback call.
callbackthe function to be removed
Return values
ProfisharkAPIRet_Successon success
ProfisharkAPIRet_NotExistif the function was not registered

◆ ProfisharkAPIRemoveDeviceGoneCallback()

PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIRemoveDeviceGoneCallback ( ProfisharkApiCallback callback)

Remove a function from the list of functions called when a new Profishark device is disconnected.

Parameters
callbackthe function to be removed
Return values
ProfisharkAPIRet_Successon success
ProfisharkAPIRet_NotExistif the function was not registered
Deprecated
Deprecated, use ProfisharkAPIRemoveGlobalCallback

◆ ProfisharkAPIRemoveGlobalCallback()

PROFISHARKAPI_API ProfisharkAPIRet ProfisharkAPIRemoveGlobalCallback ( ProfisharkApiGlobalCallbackType type,
ProfisharkApiCallbackExt callback )

Remove a global callback function.

Parameters
typethe type of callback to remove. Must be the same as the one used for the ProfisharkAPIAddGlobalCallback call.
callbackthe function to be removed
Return values
ProfisharkAPIRet_Successon success
ProfisharkAPIRet_NotExistif the function was not registered

◆ ProfisharkAPIRemoveNewDeviceCallback()

PROFISHARKAPI_API_DEPRECATED ProfisharkAPIRet ProfisharkAPIRemoveNewDeviceCallback ( ProfisharkApiCallback callback)

Remove a function from the list of functions called when a new Profishark device is detected.

Parameters
callbackthe function to be removed
Return values
ProfisharkAPIRet_Successon success
ProfisharkAPIRet_NotExistif the function was not registered
Deprecated
Deprecated, use ProfisharkAPIRemoveGlobalCallback