Interface for being notified when a driver event happened. More...
Typedefs | |
typedef void __stdcall * | CVBDRIVER_NOTIFY_CB(CVNotifyEvent_t EventID, void *Buf, size_t Size, CVNotifyDatatype_t DataType, void *UserData) |
Callback function which is called with INotify related events. This function can be registered by the NORegister function to get notifications. More... | |
typedef cvbval_t | CVNotifyDatatype_t |
Defines the datatype for the INotify data. See CVNotifyDatatypes for possible types. More... | |
typedef cvbval_t | CVNotifyEvent_t |
Defines the data type/IDs for the INotify events. See CVNotifyEventIDs for possible types. More... | |
typedef cvbval_t | CVNotifyInfo_t |
Defines the data type for the INotify information. See CVNotifyInfoCmd for possible information commands. More... | |
Enumerations | |
enum | CVNotifyDatatypes { CVNO_DATA_VOID = -1 , CVNO_DATA_INTEGER64 = 0 , CVNO_DATA_FLOAT64 , CVNO_DATA_STRING , CVNO_DATA_BINARY , CVNO_DATA_BOOL8 , CVNO_DATA_CUSTOM = 0x10000 } |
Defines the Notify data types. More... | |
enum | CVNotifyEventIDs { CVNO_REGISTRATION_INVALID = 0 , CVNO_EID_ERROR = 1 , CVNO_EID_DEVICE_DISCONNECTED = 2 , CVNO_EID_DEVICE_RECONNECT = 3 , CVNO_EID_GEOMETRY_CHANGE = 4 , CVNO_EID_METADATA_CHANGE = 5 , CVNO_EID_CUSTOM = 0x10000 } |
An EventID references a single event source. It is a number. The numbers below 0x1000 have a globally defined meaning. The numbers above are driver implementation private and may have other meanings with other sources. More... | |
enum | CVNotifyInfoCmd { CVNO_INFO_COUNT_REGISTERED , CVNO_INFO_COUNT_FIRED , CVNO_INFO_IS_AVAILABLE , NO_INFO_CUSTOM_CMD = 0x10000 } |
Defines the command for getting an information from the Notify interface. More... | |
Functions | |
cvbbool_t | CanNotify (IMG Image) |
This function verifies whether the image supports the INotify interface. More... | |
cvbres_t | NOGetDescription (IMG Image, size_t Index, char *DescriptiveName, size_t &Size, CVNotifyEvent_t &EventID) |
Inquire a readable description (name) and the event ID for a given Index. More... | |
cvbres_t | NOGetNumSupported (IMG Image, size_t &NumEvents) |
Iniquire the number of supported event sources. More... | |
cvbres_t | NOGetStatus (IMG Image, CVNotifyEvent_t eventID, CVNotifyInfo_t StatusCmd, cvbint64_t &Info) |
Inquire additional information on an event source. More... | |
cvbres_t | NOIsCookieValid (IMG Image, intptr_t Cookie, cvbbool_t &IsValid) |
Inquire if a given Cookie is still referring to a registered callback. More... | |
cvbres_t | NORegister (IMG Image, CVNotifyEvent_t EventID, CVBDRIVER_NOTIFY_CB pCB, void *UserData, intptr_t &Cookie) |
Register a callback for one (or more) events. More... | |
cvbres_t | NOUnregister (IMG Image, intptr_t Cookie) |
Unregister a callback. More... | |
Interface for being notified when a driver event happened.
typedef void __stdcall * CVBDRIVER_NOTIFY_CB(CVNotifyEvent_t EventID, void *Buf, size_t Size, CVNotifyDatatype_t DataType, void *UserData) |
Callback function which is called with INotify related events.
This function can be registered by the NORegister function to get notifications.
[in] | EventID | ID identifying a single event source. |
[in] | Buf | Databuffer associated with that event. |
[in] | Size | Size of Buf in bytes. |
[in] | DataType | Datatype (see CVNotifyDatatype_t for more information). |
[in] | UserData | Pointer to private data provided at callback registration with NORegister. |
typedef cvbval_t CVNotifyDatatype_t |
Defines the datatype for the INotify data. See CVNotifyDatatypes for possible types.
typedef cvbval_t CVNotifyEvent_t |
Defines the data type/IDs for the INotify events. See CVNotifyEventIDs for possible types.
typedef cvbval_t CVNotifyInfo_t |
Defines the data type for the INotify information. See CVNotifyInfoCmd for possible information commands.
enum CVNotifyDatatypes |
Defines the Notify data types.
enum CVNotifyEventIDs |
An EventID references a single event source.
It is a number. The numbers below 0x1000 have a globally defined meaning. The numbers above are driver implementation private and may have other meanings with other sources.
enum CVNotifyInfoCmd |
Defines the command for getting an information from the Notify interface.
cvbbool_t CanNotify | ( | IMG | Image | ) |
cvbres_t NOGetDescription | ( | IMG | Image, |
size_t | Index, | ||
char * | DescriptiveName, | ||
size_t & | Size, | ||
CVNotifyEvent_t & | EventID | ||
) |
Inquire a readable description (name) and the event ID for a given Index.
This ID is used to register/unregister an event.
[in] | Image | Handle of image object. |
[in] | Index | Index for the supported notify events list. The range is from 0 to NotifyEventCount
|
[in,out] | DescriptiveName | Gets the human readable event name for the given index. |
[in,out] | Size | Size of Buffer in bytes. |
[out] | EventID | Unique number identifying a single source of events (see CVNotifyEvent_t) |
cvbres_t NOGetNumSupported | ( | IMG | Image, |
size_t & | NumEvents | ||
) |
Iniquire the number of supported event sources.
[in] | Image | Handle of image object. |
[out] | NumEvents | Number of supported event sources. |
cvbres_t NOGetStatus | ( | IMG | Image, |
CVNotifyEvent_t | eventID, | ||
CVNotifyInfo_t | StatusCmd, | ||
cvbint64_t & | Info | ||
) |
Inquire additional information on an event source.
For example: Number of callbacks registered or number of times fired Availability at a certain time.
[in] | Image | Handle of image object. |
[in] | eventID | Unique number identifying a single source of events. If a 0 is passed as argument the callback will receive ALL events from a driver instance (see CVNotifyEvent_t). |
[in] | StatusCmd | Possible command to execute like CVNO_INFO_COUNT_REGISTERED (see CVNotifyInfo_t for more information). |
[out] | Info | A number referencing a certain information related to an EventID. |
cvbres_t NOIsCookieValid | ( | IMG | Image, |
intptr_t | Cookie, | ||
cvbbool_t & | IsValid | ||
) |
Inquire if a given Cookie is still referring to a registered callback.
[in] | Image | Handle of image object. |
[in] | Cookie | Is a unique handle referencing a single callback registration. |
[out] | IsValid | TRUE , if cookie is valid, FALSE otherwise. |
cvbres_t NORegister | ( | IMG | Image, |
CVNotifyEvent_t | EventID, | ||
CVBDRIVER_NOTIFY_CB | pCB, | ||
void * | UserData, | ||
intptr_t & | Cookie | ||
) |
Register a callback for one (or more) events.
The callback stays registered until either the driver is unloaded, the NOUnregister function is called or the CVNO_REGISTRATION_INVALID (see CVNotifyEventIDs) is fired. With a driver unload the callback is unregistered automatically. After a reload of the driver the callback has to be registered again.
[in] | Image | Handle of image object. |
[in] | EventID | Unique number identifying a single source of events. If a 0 is passed as argument the callback will receive ALL events from a driver instance (see CVNotifyEvent_t). |
[in] | pCB | Callback function (see CVBDRIVER_NOTIFY_CB) |
[in] | UserData | User provided pointer to private data which gets passed to the event callback function. |
[out] | Cookie | Cookie referencing a single callback registration. This cookie must be used to unregister the callback. The cookie might change from session to session. |
cvbres_t NOUnregister | ( | IMG | Image, |
intptr_t | Cookie | ||
) |
Unregister a callback.
In case of a driver unload this unregister is done automatically.
[in] | Image | Handle of image object. |
[in] | Cookie | Is a unique handle referencing a single callback registration. |