GEV Server (CVGevServer.dll) 14.0
GEV Server Functions

Functions

GEVSRV CreateGevServer ()
 Creates a GigE Vision Server version 1 object. More...
 
GEVSRV CreateGevServer2 (TDriver DriverType, const GSInitInfo &InitInfo)
 Creates a GigE Vision Server version 2 object with the specified DriverType. More...
 
GEVSRV CreateGevServerEx (TDriver DriverType)
 Creates a GigE Vision Server version 1 object with the specified DriverType. More...
 
cvbres_t GSDriverType (GEVSRV Server, TDriver &DriverType)
 Gets which GigE Vision driver type is used by the server. More...
 
cvbbool_t GSDriverTypePresent (TDriver DriverType)
 Gets whether the given DriverType is available on this machine. More...
 
cvbres_t GSGetAcquisitionMode (GEVSRV Server, TAcquisitionMode &Mode)
 Gets the acquisition Mode used by the Server. More...
 
cvbres_t GSGetImage (GEVSRV Server, IMG &Image)
 Gets the image object currently used by the Server object. More...
 
cvbres_t GSGetInfoAsFloat (GEVSRV Server, TGSInfo Cmd, double &Info)
 Queries an information specified in Cmd from the given Server. More...
 
cvbres_t GSGetInfoAsInteger (GEVSRV Server, TGSInfo Cmd, cvbint64_t &Info)
 Queries an information specified in Cmd from the given Server. More...
 
cvbres_t GSGetInfoAsString (GEVSRV Server, TGSInfo Cmd, char *Info, size_t &Length)
 Queries an information specified in Cmd from the given Server as C string. More...
 
cvbres_t GSGetInfoAsStringW (GEVSRV Server, TGSInfo Cmd, wchar_t *Info, size_t &Length)
 Queries an information specified in Cmd from the given Server as wide C string. More...
 
cvbres_t GSGetLastErrorString (char *Error, size_t &Length)
 Gets the last string describing the reason of the last error. More...
 
cvbres_t GSGetLocalIPv4 (GEVSRV Server, gsipv4 &IPv4, gsport &Port)
 Gets the IPv4 address and Port of this server instance. More...
 
cvbres_t GSGetRemoteIPv4 (GEVSRV Server, gsipv4 &IPv4, gsport &Port)
 Gets the IPv4 address and Port of the controlling application. More...
 
cvbres_t GSIsGenApiEventActive (GEVSRV Server, cvbuint16_t eventID, cvbbool_t &active)
 
cvbres_t GSRegisterEvent (GEVSRV Server, TServerEvent EventID, TFGEVSrv Callback, void *pPrivate, size_t &CallbackID)
 Registers the given EventID Callback on the Server. More...
 
cvbres_t GSRegisterGenApiEvent (GEVSRV Server, const char *EventName, TGSNamespace Namespace, cvbuint16_t &eventID)
 Registers a GenApi event with the given EventName as C string. More...
 
cvbres_t GSRegisterGenApiEventW (GEVSRV Server, const wchar_t *EventName, TGSNamespace Namespace, cvbuint16_t &eventID)
 Registers a GenApi event with the given EventName as wide C string. More...
 
cvbres_t GSSendBlock (GEVSRV Server, const GSDataBlock &BlockInfo, const cvbuint8_t *pBlock, size_t BlockSize, TFGEVSrv BlockRelease, void *pPrivate)
 Sends a block of data identified by the given BlockInfo. More...
 
cvbres_t GSSendCurrentImage (GEVSRV Server)
 Sends the image previously set by GSSetImage to the remote endpoint. More...
 
cvbres_t GSSendEvent (GEVSRV Server, cvbuint16_t eventID)
 Sends a single event to the associated remote device. More...
 
cvbres_t GSSendEventData (GEVSRV Server, cvbuint16_t eventID, const cvbuint8_t *pData, size_t DataSize)
 Sends an event with additional data to the associated remote device. More...
 
cvbres_t GSSendImage (GEVSRV Server, IMG Image)
 Sends the given Image to the remote endpoint. More...
 
cvbres_t GSSendImageCB (GEVSRV Server, IMG Image, TFGEVSrv ImageBlockRelease, void *pPrivate)
 Sends the given Image to the remote endpoint. More...
 
cvbres_t GSSetAcquisitionMode (GEVSRV Server, TAcquisitionMode Mode)
 Sets the acquisition Mode to be used by the Server. More...
 
cvbres_t GSSetImage (GEVSRV Server, IMG Image)
 Sets the image object to be used by the given Server object. More...
 
cvbres_t GSSetInfoAsFloat (GEVSRV Server, TGSInfo Cmd, double Info)
 Sets an information specified in Cmd from the given Server. More...
 
cvbres_t GSSetInfoAsInteger (GEVSRV Server, TGSInfo Cmd, cvbint64_t Info)
 Sets an information specified in Cmd from the given Server. More...
 
cvbres_t GSSetInfoAsString (GEVSRV Server, TGSInfo Cmd, const char *Info)
 Sets an information specified in Cmd from the given Server. More...
 
cvbres_t GSSetInfoAsStringW (GEVSRV Server, TGSInfo Cmd, const wchar_t *Info)
 Sets an information specified in Cmd from the given Server as a wide C string. More...
 
cvbres_t GSStartIPv4 (GEVSRV Server, gsipv4 IPv4)
 Starts the given Server and binds it to the given IPv4 address at the standard GigE Vision control port (3956). More...
 
cvbres_t GSStartIPv4Ex (GEVSRV Server, gsipv4 IPv4, gsport Port)
 Extended version of the GSStartIPv4 function. More...
 
cvbres_t GSStartIPv4List (GEVSRV Server, const gsipv4 *IPv4List, size_t IPv4ListLength)
 List version of the GSStartIPv4 function. More...
 
cvbres_t GSStop (GEVSRV Server)
 Stops the currently running Server. More...
 
cvbres_t GSUnregisterEvent (GEVSRV Server, TServerEvent EventID, size_t CallbackID)
 Unregisters the given EventID from the Server. More...
 
cvbbool_t IsGevServer (GEVSRV Server)
 Tries to check whether the given Server handle is a valid object. More...
 

Detailed Description

Function Documentation

◆ CreateGevServer()

GEVSRV CreateGevServer ( )

Creates a GigE Vision Server version 1 object.

This function automatically chooses the fastest available driver:

  • Filter driver is the first choice
  • Socket driver is the fall-back if no filter driver can be found.

This server supports all acquisition modes in #TAcquisitionMode. Also gzipped image transfer can be enabled in the client.

The created object is not started (not bound to an IP/port) and thus is freely configurable. By default no streaming is available (GSSetImage must be called if streaming is wanted) and packet resend is disabled for backwards compatibility.

After the basic configuration is done, call the GSStartIPv4 or GSStartIPv4Ex function.

Attention
Call the ReleaseObject function on the returned handle if it is not needed anymore.
Returns
GEVSRV handle of the GigE Vision Server object; nullptr on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServerEx, IsGevServer, GSSetImage, GSStartIPv4
See Driver Type and CVB GEV Server Setup and Possible States in the Theory of Operation chapter.
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
This C++ example shows how to start (and stop) a GEV Server and assign a CVB image to it:
#include <iostream>
#include <vector>
#include <iCVGEVServer.h>
void PrintLastError()
{
size_t bufferSize = 0;
GSGetLastErrorString(nullptr, bufferSize);
if(bufferSize == 0)
return; // nothing to print
std::vector buffer(bufferSize);
GSGetLastErrorString(&buffer[0], bufferSize);
std::cout << &buffer[0] << std::endl;
}
gsipv4 GetFirstInterface()
{
// check if interfaces are available
if(hList == nullptr || ILCount(hList) == 0 || ILCount(hList) == size_t(-1))
{
PrintLastError();
return 0;
}
// get first IP
gsipv4 ip = 0;
cvbres_t result = ILIPv4Address(hList, 0, ip);
ReleaseObject(hList);
if(result < 0)
PrintLastError();
return ip;
}
GEVSRV CreateAndStartGevServerFromImage(IMG hImage)
{
// create server
GEVSRV hServer = CreateGevServer();
if(hServer == nullptr)
{
PrintLastError();
return nullptr;
}
// server in configuration state: set image
cvbres_t result = GSSetImage(hServer, hImage);
if(result < 0)
{
PrintLastError();
ReleaseObject(hServer);
return nullptr;
}
// start server and leave configuration state
gsipv4 ip = GetFirstInterface();
nResult = GSStartIPv4(hServer, ip);
if(result < 0)
{
PrintLastError();
ReleaseObject(hServer);
return nullptr;
}
return hServer;
}
void StopAndDestroyGevServer(GEVSRV hServer)
{
if(!IsGevServer(hServer))
return; // nothing to stop
cvbres_t result = GSStop(hServer);
if(result < 0)
PrintLastError();
ReleaseObject(hServer);
}
cvbbool_t IsGevServer(GEVSRV Server)
Tries to check whether the given Server handle is a valid object.
Definition: GevServerExports.cpp:2093
cvbres_t GSGetLastErrorString(char *Error, size_t &Length)
Gets the last string describing the reason of the last error.
Definition: GevServerExports.cpp:1712
cvbres_t GSStartIPv4(GEVSRV Server, gsipv4 IPv4)
Starts the given Server and binds it to the given IPv4 address at the standard GigE Vision control po...
Definition: GevServerExports.cpp:2181
cvbres_t GSStop(GEVSRV Server)
Stops the currently running Server.
Definition: GevServerExports.cpp:2466
GEVSRV CreateGevServer()
Creates a GigE Vision Server version 1 object.
Definition: GevServerExports.cpp:1852
cvbres_t GSSetImage(GEVSRV Server, IMG Image)
Sets the image object to be used by the given Server object.
Definition: GevServerExports.cpp:2585
size_t ILCount(GEVIFACELIST List)
Gets the number of available network interfaces in the given List.
Definition: GevServerExports.cpp:1239
cvbres_t ILIPv4Address(GEVIFACELIST List, size_t Index, gsipv4 &IPv4)
Gets the IP address of the logical interface at the given Index.
Definition: GevServerExports.cpp:1295
GEVIFACELIST CreateInterfaceList()
Creates the ref-counted GEVIFACELIST object.
Definition: GevServerExports.cpp:1170
void * GEVIFACELIST
Handle of a logical interface list object.
Definition: iCVGevServer.h:30
void * GEVSRV
Handle of a GEV Server object.
Definition: iCVGevServer.h:29

◆ CreateGevServer2()

GEVSRV CreateGevServer2 ( TDriver  DriverType,
const GSInitInfo &  InitInfo 
)

Creates a GigE Vision Server version 2 object with the specified DriverType.

This server only supports AM_Manual acquisition mode and does not support gzipped sending (can be done externally now).

The created object is not started (not bound to an IP/port) and thus is freely configurable. By default streaming is available as defined by the InitInfo and packet resend is enabled (if supported by the driver).

After the basic configuration is done, call the GSStartIPv4 or GSStartIPv4Ex function.

Note
Use DT_Auto or DT_Filter for transfer to another machine and DT_Socket for loop-back transfer (also use the socket driver with the GenICam.vin)!
Attention
Call the ReleaseObject function on the returned handle if it is not needed anymore.
Parameters
[in]DriverTypeType of GigE Vision driver to use:
[in]InitInfoInitialization structure with default values for a server that can stream image data.
Returns
GEVSRV handle of the GigE Vision Server object; nullptr on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Examples:
None

◆ CreateGevServerEx()

GEVSRV CreateGevServerEx ( TDriver  DriverType)

Creates a GigE Vision Server version 1 object with the specified DriverType.

This server supports all acquisition modes in #TAcquisitionMode. Also gzipped image transfer can be enabled in the client.

The created object is not started (not bound to an IP/port) and thus is freely configurable. By default no streaming is available (GSSetImage must be called if streaming is wanted) and packet resend is disabled for backwards compatibility.

After the basic configuration is done, call the GSStartIPv4 or GSStartIPv4Ex function.

Note
Use DT_Auto or DT_Filter for transfer to another machine and DT_Socket for loop-back transfer (also use the socket driver with the GenICam.vin)!
Attention
Call the ReleaseObject function on the returned handle if it is not needed anymore.
Parameters
[in]DriverTypeType of GigE Vision driver to use:
Returns
GEVSRV handle of the GigE Vision Server object; nullptr on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC GevServer Example
Sample code in Visual C++:
An example on how to create a server can be found in the CreateGevServer function documentation.

◆ GSDriverType()

cvbres_t GSDriverType ( GEVSRV  Server,
TDriver &  DriverType 
)

Gets which GigE Vision driver type is used by the server.

Parameters
[in]ServerServer object to query.
[out]DriverTypeType of GigE Vision driver used:
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics
CreateGevServer, CreateGevServerEx

◆ GSDriverTypePresent()

cvbbool_t GSDriverTypePresent ( TDriver  DriverType)

Gets whether the given DriverType is available on this machine.

Parameters
[in]DriverTypeSocket or filter driver to be tested for availability.
Returns
TRUE if the given DriverType is available; FALSE otherwise.
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx
See Driver Type in Theory of Operation.
Examples:
Visual C++ - VC GevServer Example

◆ GSGetAcquisitionMode()

cvbres_t GSGetAcquisitionMode ( GEVSRV  Server,
TAcquisitionMode &  Mode 
)

Gets the acquisition Mode used by the Server.

Parameters
[in]ServerServer object to query property.
[out]ModeCurrent acquisition mode of the server. See #TAcquisitionMode for possible modes.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSSetAcquisitionMode, GSStartIPv4
See the Acquisition Mode in the Theory of Operation chapter.

◆ GSGetImage()

cvbres_t GSGetImage ( GEVSRV  Server,
IMG &  Image 
)

Gets the image object currently used by the Server object.

Parameters
[in]ServerServer object to query property.
[out]ImageHandle of the image object currently used; nullptr if none is set.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSGetAcquisitionMode, GSSetAcquisitionMode

◆ GSGetInfoAsFloat()

cvbres_t GSGetInfoAsFloat ( GEVSRV  Server,
TGSInfo  Cmd,
double &  Info 
)

Queries an information specified in Cmd from the given Server.

Since
CVB 14.00.000
Parameters
[in]ServerServer to query information from.
[in]CmdInformation to query.
[out]InfoTo be filled with queried information.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSGetInfoAsFloat, GSGetInfoAsString, GSSetInfoAsString
Information about the data to query can be found in the #TGSInfo documentation.
See the Device and XML Description versioning for more information.

◆ GSGetInfoAsInteger()

cvbres_t GSGetInfoAsInteger ( GEVSRV  Server,
TGSInfo  Cmd,
cvbint64_t &  Info 
)

Queries an information specified in Cmd from the given Server.

Parameters
[in]ServerServer to query information from.
[in]CmdInformation to query.
[out]InfoTo be filled with queried information.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSGetInfoAsInteger, GSGetInfoAsString, GSSetInfoAsString
Information about the data to query can be found in the #TGSInfo documentation.
See the Device and XML Description versioning for more information.

◆ GSGetInfoAsString()

cvbres_t GSGetInfoAsString ( GEVSRV  Server,
TGSInfo  Cmd,
char *  Info,
size_t &  Length 
)

Queries an information specified in Cmd from the given Server as C string.

Parameters
[in]ServerServer to query information from.
[in]CmdInformation to query.
[in]InfoC string to be filled with queried information; nullptr for size query.
[in,out]LengthIf Info is nullptr: Receives minimal buffer size needed; Size of Info in bytes (including zero termination) otherwise.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSGetInfoAsInteger, GSSetInfoAsInteger, GSSetInfoAsString
Information about the data to query can be found in the #TGSInfo documentation.
See the Device and XML Description Versioning for more information.

◆ GSGetInfoAsStringW()

cvbres_t GSGetInfoAsStringW ( GEVSRV  Server,
TGSInfo  Cmd,
wchar_t *  Info,
size_t &  Length 
)

Queries an information specified in Cmd from the given Server as wide C string.

Since
CVB 14.00.000
Parameters
[in]ServerServer to query information from.
[in]CmdInformation to query.
[in]InfoWide C string to be filled with queried information; nullptr for size query.
[in,out]LengthIf Info is nullptr: Receives minimal buffer size needed; Size of Info in bytes (including zero termination) otherwise.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSGetInfoAsInteger, GSSetInfoAsInteger, GSSetInfoAsString
Information about the data to query can be found in the #TGSInfo documentation.
See the device and XML description versioning for more information.

◆ GSGetLastErrorString()

cvbres_t GSGetLastErrorString ( char *  Error,
size_t &  Length 
)

Gets the last string describing the reason of the last error.

Note
Error strings are stored thread local.
Parameters
[in]ErrorBuffer to be filled with last error message; nullptr to inquire minimal buffer size.
[in,out]LengthNumber of bytes Error buffer has if Error is not nullptr; if it is nullptr this parameter will contain the minimal number of bytes needed for the Error buffer including zero-termination.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC GevServer Example
Sample code in Visual C++
For an example on how to use this function see e.g. the CreateGevServer function.

◆ GSGetLocalIPv4()

cvbres_t GSGetLocalIPv4 ( GEVSRV  Server,
gsipv4 &  IPv4,
gsport &  Port 
)

Gets the IPv4 address and Port of this server instance.

If the server has not been started, the IPv4 and Port are 0.

Parameters
[in]ServerServer object to query.
[out]IPv4IP Address of the local endpoint. 0 for none.
[out]PortPort of the local endpoint. 0 for none.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, IsGevServer, GSStartIPv4, GSIPv4ToString, GSGetRemoteIPv4

◆ GSGetRemoteIPv4()

cvbres_t GSGetRemoteIPv4 ( GEVSRV  Server,
gsipv4 &  IPv4,
gsport &  Port 
)

Gets the IPv4 address and Port of the controlling application.

The controlling application is the remote endpoint. If no remote application is controlling the Server both IPv4 and Port are 0.

Parameters
[in]ServerServer object to query.
[out]IPv4IP Address of the remote endpoint. 0 for none.
[out]PortPort of the remote endpoint. 0 for none.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, IsGevServer, GSStartIPv4, GSIPv4ToString, GSGetLocalIPv4

◆ GSIsGenApiEventActive()

cvbres_t GSIsGenApiEventActive ( GEVSRV  Server,
cvbuint16_t  eventID,
cvbbool_t &  active 
)
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSendEvent, GSSendEventData, GSRegisterGenApiEvent

◆ GSRegisterEvent()

cvbres_t GSRegisterEvent ( GEVSRV  Server,
TServerEvent  EventID,
TFGEVSrv  Callback,
void *  pPrivate,
size_t &  CallbackID 
)

Registers the given EventID Callback on the Server.

If the Server object is destroyed all callbacks are unregistered automatically.

Note
The CallbackID is unique dependent on the EventID and Server used. Thus two different Server instances can return the same CallbackID for the same EventID.
Attention
The callback function is called from an internal thread and thus is in a different thread context than the function calling this function. Depending on the EventID no lengthy processing should be done in the called function as otherwise the connection to the remote client might break.
Parameters
[in]ServerServer object to register event on.
[in]EventIDEvent type to get notified on.
[in]CallbackFunction pointer to function which is called in case the event is fired.
[in]pPrivatePointer to private data given as the callback function's parameter (e.g. pointer to a class).
[out]CallbackIDServer and EventID unique callback ID. Use this ID to unregister the Callback.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSStartIPv4, GSUnregisterEvent
Examples:
Visual C++ - VC GevServer Example

◆ GSRegisterGenApiEvent()

cvbres_t GSRegisterGenApiEvent ( GEVSRV  Server,
const char *  EventName,
TGSNamespace  Namespace,
cvbuint16_t &  eventID 
)

Registers a GenApi event with the given EventName as C string.

This function creates the necessary GenApi nodes for event notification. After registration events can be sent via the GSSendEvent function if they have been activated by the remote client (check with GSIsGenApiEventActive).

Parameters
[in]ServerServer object to register event on.
[in]EventNameName of the event to register.
[in]NamespaceNamespace of the GenApi nodes (GSNS_Standard for SFNC events).
[out]eventIDThe registered event ID.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSendEvent, GSSendEventData, GSIsGenApiEventActive

◆ GSRegisterGenApiEventW()

cvbres_t GSRegisterGenApiEventW ( GEVSRV  Server,
const wchar_t *  EventName,
TGSNamespace  Namespace,
cvbuint16_t &  eventID 
)

Registers a GenApi event with the given EventName as wide C string.

Since
CVB 14.00.000

This function creates the necessary GenApi nodes for event notification. After registration events can be sent via the GSSendEvent function if they have been activated by the remote client (check with GSIsGenApiEventActive).

Parameters
[in]ServerServer object to register event on.
[in]EventNameName of the event to register.
[in]NamespaceNamespace of the GenApi nodes (GSNS_Standard for SFNC events).
[out]eventIDThe registered event ID.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSendEvent, GSSendEventData, GSIsGenApiEventActive

◆ GSSendBlock()

cvbres_t GSSendBlock ( GEVSRV  Server,
const GSDataBlock &  BlockInfo,
const cvbuint8_t *  pBlock,
size_t  BlockSize,
TFGEVSrv  BlockRelease,
void *  pPrivate 
)

Sends a block of data identified by the given BlockInfo.

This function only is available in the AM_Manual acquisition mode. Also a remote endpoint must be present and the acquisition must have been started by the client.

In AM_Manual mode the SE_AcquisitionStart and SE_AcquisitionStop events can be used to get notified when the remote client starts and stops image streaming.

Attention
For no-copy packet resend the GEV Server references the given pBuffer to be able to resend single packets. The content of the given pBuffer and the memory itself must not change until the ImageBlockRelease is called with the given pPrivate. Use different pPrivate data to distinguish between multiple referenced buffers.
It is the callers responsibility to provide a valid buffer layout in pBlock!
Parameters
[in]ServerServer object to send buffer with.
[in]BlockInfoInformation about the packet type to stream, color format, dimensions, etc.
[in]pBlockPointer to the data block to send.
[in]BlockSizeSize of pBlock in bytes.
[in]BlockReleaseCallback that is called when the image data in hImage is not needed anymore.
[in]pPrivatePrivate data pointer given to each ImageBlockRelease call.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
GSSendImage, GSSendImageCB, CreateGevServer, CreateGevServerEx, CreateGevServer2, GSStartIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendCurrentImage
See the Acquisition Mode in the Theory of Operation chapter

◆ GSSendCurrentImage()

cvbres_t GSSendCurrentImage ( GEVSRV  Server)

Sends the image previously set by GSSetImage to the remote endpoint.

This function only is available in the AM_Manual acquisition mode. Also a remote endpoint must be present and the acquisition must be enabled.

In AM_Manual mode the SE_AcquisitionStart and SE_AcquisitionStop events can be used to get notified when the remote client starts and stops image streaming.

Attention
This does not work with a 2.x server object.
Parameters
[in]ServerServer object to send image with.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSStartIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendImage
See the Acquisition Mode in the Theory of Operation chapter.

◆ GSSendEvent()

cvbres_t GSSendEvent ( GEVSRV  Server,
cvbuint16_t  eventID 
)

Sends a single event to the associated remote device.

Events are asynchronous messages from the server to the remote device, i.e. application.

No checks are done on the given eventID. The timestamp used for the event is the current Server timestamp tick at the time of the call.

Remarks
This operation is only possible if the remote device enabled the message channel.
Parameters
[in]ServerServer object to send event with.
[in]eventIDEvent identifier (0x9000 and higher for custom ones).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, CreateGevServer2, GSStartIPv4, GSGetRemoteIPv4, GSRegisterEvent

◆ GSSendEventData()

cvbres_t GSSendEventData ( GEVSRV  Server,
cvbuint16_t  eventID,
const cvbuint8_t *  pData,
size_t  DataSize 
)

Sends an event with additional data to the associated remote device.

Events are asynchronous messages from the server to the remote device, i.e. application.

No checks are done on the given eventID. The timestamp used for the event is the current Server timestamp tick at the time of the call.

Remarks
This operation is only possible if the remote device enabled the message channel.
Parameters
[in]ServerServer object to send event with.
[in]eventIDEvent identifier (0x9000 and higher for custom ones).
[in]pDataAdditional event data buffer to send.
[in]DataSizeSize of pData in bytes (up to 540 bytes).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, CreateGevServer2, GSStartIPv4, GSGetRemoteIPv4, GSRegisterEvent

◆ GSSendImage()

cvbres_t GSSendImage ( GEVSRV  Server,
IMG  Image 
)

Sends the given Image to the remote endpoint.

This function only is available in the AM_Manual acquisition mode. Also a remote endpoint must be present and the acquisition must have been started by the client.

In AM_Manual mode the SE_AcquisitionStart and SE_AcquisitionStop events can be used to get notified when the remote client starts and stops image streaming.

Attention
When this function is used when packet resend is enabled, the GEV Server always copies the image data to have an intact resend queue. To prevent this use a supported image buffer format and the GSSendImageCB function.
Parameters
[in]ServerServer object to send image with.
[in]ImageImage to send. This image must be compatible to the one set via GSSetImage (meaning same dimension and color format).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
GSSendImageCB, CreateGevServer, CreateGevServerEx, GSSetImage, GSStartIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendCurrentImage
See the Acquisition Mode in the Theory of Operation chapter

◆ GSSendImageCB()

cvbres_t GSSendImageCB ( GEVSRV  Server,
IMG  Image,
TFGEVSrv  ImageBlockRelease,
void *  pPrivate 
)

Sends the given Image to the remote endpoint.

This function only is available in the AM_Manual acquisition mode. Also a remote endpoint must be present and the acquisition must have been started by the client.

In AM_Manual mode the SE_AcquisitionStart and SE_AcquisitionStop events can be used to get notified when the remote client starts and stops image streaming.

Attention
For no-copy packet resend the GEV Server references the given Image to be able to resend single packets. The content of the given Image and the image object itself must not change until the ImageBlockRelease is called with the given pPrivate. Use different pPrivate data to distinguish between multiple referenced images.
Parameters
[in]ServerServer object to send image with.
[in]ImageImage to send. This image must be compatible to the one set via GSSetImage (meaning same dimension and color format).
[in]ImageBlockReleaseCallback that is called when the image data in hImage is not needed anymore.
[in]pPrivatePrivate data pointer given to each ImageBlockRelease call.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
GSSendImage, CreateGevServer, CreateGevServerEx, GSSetImage, GSStartIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendCurrentImage
See the Acquisition Mode in the Theory of Operation chapter

◆ GSSetAcquisitionMode()

cvbres_t GSSetAcquisitionMode ( GEVSRV  Server,
TAcquisitionMode  Mode 
)

Sets the acquisition Mode to be used by the Server.

The possible acquisition mode depends on the set image object:

  • AM_None: Image handle is nullptr.
  • AM_Manual: Image object is valid but does not support a grabber interface like IGrab2
  • AM_Automatic: Image object is valid and supports a grabber interface.

When a new image is set to the Server the highest possible mode is set (see GSSetImage function).

Attention
This is only possible as long as the Server has not been started yet.
Parameters
[in]ServerServer object to set property.
[in]ModeNew acquisition mode to be used by the Server.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSGetAcquisitionMode, GSStartIPv4
See the Acquisition Mode in the Theory of Operation chapter.

◆ GSSetImage()

cvbres_t GSSetImage ( GEVSRV  Server,
IMG  Image 
)

Sets the image object to be used by the given Server object.

This function sets the acquisition mode depending on the supported interfaces:

  • AM_None: Image handle is nullptr.
  • AM_Manual: Image object is valid but does not support a grabber interface like IGrab2
  • AM_Automatic: Image object is valid and supports a grabber interface.

This value can only be set while the server is not running (not started). If a new image is to be sent while the Server is running use the AM_Manual and the GSSendImage function.

Note
If AM_Manual is used the given image is not sent - it simply is used as a placeholder object to define image dimensions.
Parameters
[in]ServerServer object to set property.
[in]ImageImage to be used by Server.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSStartIPv4, GSSendImage, GSSendCurrentImage
See the Acquisition Mode in the Theory of Operation chapter.
Examples:
Visual C++ - VC GevServer Example

◆ GSSetInfoAsFloat()

cvbres_t GSSetInfoAsFloat ( GEVSRV  Server,
TGSInfo  Cmd,
double  Info 
)

Sets an information specified in Cmd from the given Server.

Since
CVB 14.00.000
Attention
Most information can only be set while the server is not running.
Parameters
[in]ServerServer to set information to.
[in]CmdInformation to set.
[in]InfoInformation to set.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSStartIPv4, GSGetInfoAsString, GSSetInfoAsString
Information about the settable data can be found in the #TGSInfo documentation.
See the Device and XML Description versioning for more information.

◆ GSSetInfoAsInteger()

cvbres_t GSSetInfoAsInteger ( GEVSRV  Server,
TGSInfo  Cmd,
cvbint64_t  Info 
)

Sets an information specified in Cmd from the given Server.

Attention
Most information can only be set while the server is not running.
Parameters
[in]ServerServer to set information to.
[in]CmdInformation to set.
[in]InfoInformation to set.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSStartIPv4, GSGetInfoAsString, GSGetInfoAsString, GSSetInfoAsString
Information about the settable data can be found in the #TGSInfo documentation.
See the Device and XML Description Versioning for more information.
Examples:
Visual C++ - VC GevServer Example

◆ GSSetInfoAsString()

cvbres_t GSSetInfoAsString ( GEVSRV  Server,
TGSInfo  Cmd,
const char *  Info 
)

Sets an information specified in Cmd from the given Server.

Attention
Most information can only be set while the server is not running.
Parameters
[in]ServerServer to set information to.
[in]CmdType of information to set.
[in]InfoBuffer containing the new info to be set (zero terminated).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSStartIPv4, GSGetInfoAsString, GSGetInfoAsInteger, GSSetInfoAsInteger
Information about the settable data can be found in the #TGSInfo documentation.
See the Device and XML Description Versioning for more information
Examples:
Visual C++ - VC GevServer Example

◆ GSSetInfoAsStringW()

cvbres_t GSSetInfoAsStringW ( GEVSRV  Server,
TGSInfo  Cmd,
const wchar_t *  Info 
)

Sets an information specified in Cmd from the given Server as a wide C string.

Since
CVB 14.00.000
Attention
Most information can only be set while the server is not running.
Parameters
[in]ServerServer to set information to.
[in]CmdType of information to set.
[in]InfoBuffer containing the new info to be set (zero terminated).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSStartIPv4, GSGetInfoAsString, GSGetInfoAsInteger, GSSetInfoAsInteger
Information about the settable data can be found in the #TGSInfo documentation.
See the Device and XML Description Versioning for more information
Examples:
Visual C++ - VC GevServer Example

◆ GSStartIPv4()

cvbres_t GSStartIPv4 ( GEVSRV  Server,
gsipv4  IPv4 
)

Starts the given Server and binds it to the given IPv4 address at the standard GigE Vision control port (3956).

After starting the server a remote client can connect and control the server.

Note
No GenApi features can be added or removed from now on. Also write access to XML-only features is prohibited.
Parameters
[in]ServerServer object to start.
[in]IPv4IP address to bind to.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSGetLocalIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendImage, GSSendCurrentImage, GSStop
See the CVB GEV Server Setup and Possible States in the Theory of Operation chapter.
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
See the CreateGevServer function for an example.

◆ GSStartIPv4Ex()

cvbres_t GSStartIPv4Ex ( GEVSRV  Server,
gsipv4  IPv4,
gsport  Port 
)

Extended version of the GSStartIPv4 function.

After starting the server a remote client can connect and control the server.

Note
No GenApi features can be added or removed from now on. Also write access to XML-only features is prohibited.
Attention
If another Port than 3956 is used, standard compliant clients might not be able to connect to the server.
Parameters
[in]ServerServer object to start.
[in]IPv4IP address to bind to.
[in]PortPort to bind server to; 0 for the default GigE Vision control port (3956).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSGetLocalIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendImage, GSSendCurrentImage, GSStartIPv4, GSStop
See the CVB GEV Server Setup and Possible States in the Theory of Operation chapter.

◆ GSStartIPv4List()

cvbres_t GSStartIPv4List ( GEVSRV  Server,
const gsipv4 *  IPv4List,
size_t  IPv4ListLength 
)

List version of the GSStartIPv4 function.

After starting the server a remote client can connect and control the server.

The first interface specified (Interface #0) is the main interface to control the device (control and message channel). Device discovery will only list Interface #0. The other interfaces can only be used to stream data.

Note
No GenApi features can be added or removed from now on. Also write access to XML-only features is prohibited.
Parameters
[in]ServerServer object to start.
[in]IPv4ListIP addresses to bind to.
[in]IPv4ListLengthNumber of elements in IPv4List; at most four entries (GigE Vision limitation).
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSSetImage, GSGetLocalIPv4, GSGetRemoteIPv4, GSRegisterEvent, GSSendImage, GSSendCurrentImage, GSStartIPv4, GSStop
See the CVB GEV Server Setup and Possible States in the Theory of Operation chapter.

◆ GSStop()

cvbres_t GSStop ( GEVSRV  Server)

Stops the currently running Server.

This function stops the acquisition and control threads of the server and returns to the configuration state.

Attention
If the server is not needed anymore call the ReleaseObject function.
Parameters
[in]ServerServer object to stop.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
GSStartIPv4, GSStartIPv4Ex
See the CVB GEV Server Setup and Possible States in the Theory of Operation chapter.
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
See the CreateGevServer function for an example.

◆ GSUnregisterEvent()

cvbres_t GSUnregisterEvent ( GEVSRV  Server,
TServerEvent  EventID,
size_t  CallbackID 
)

Unregisters the given EventID from the Server.

The previously registered callback function is not called anymore.

Parameters
[in]ServerServer object to unregister event on.
[in]EventID#TServerEvent of the corresponding GSRegisterEvent call.
[in]CallbackIDServer and EventID unique callback ID returned by the GSRegisterEvent function.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx, GSRegisterEvent

◆ IsGevServer()

cvbbool_t IsGevServer ( GEVSRV  Server)

Tries to check whether the given Server handle is a valid object.

Attention
Always use initialized variables and initialize unused handles with nullptr.
Parameters
[in]ServerServer handle to check.
Returns
TRUE if it is a valid object, FALSE otherwise.
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateGevServer, CreateGevServerEx