Profishark API  2.3.12.0
Callbacks

Callback mechanism. More...

Data Structures

struct  ProfisharkApiCallbackValue_DiskDump
 

Typedefs

typedef void * ProfisharkApiCallbackValue
 Profishark callback value. More...
 
typedef void(* ProfisharkApiCallback) (ProfisharkApiDeviceHandle, void *)
 Callback function. More...
 
typedef void(* ProfisharkApiCallbackExt) (ProfisharkApiDeviceHandle, ProfisharkApiCallbackValue *, void *)
 Callback function. More...
 

Enumerations

enum  ProfisharkApiGlobalCallbackType { ProfisharkApiGlobalCallbackType_NewDevice, ProfisharkApiGlobalCallbackType_DeviceRemoved }
 
enum  ProfisharkApiDeviceCallbackType { ProfisharkApiDeviceCallbackType_DiskDump }
 

Functions

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

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

\ brief 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

◆ ProfisharkApiGlobalCallbackType

\ brief 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 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 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 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 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