I am trying to detect GEV-cameras on the network but on some machines it is very slow (>20s) but on “normal” machine it is 2s.
Tested with different flags, eg:
We use multiple NIC:s and also switches on our system but the cameras are using 192.168.128.* and 192.168.130.* (on two different NIC:s)…
How can it be used by Discover?
you can discover with the DiscoverFlags.UpToLevelInterface flag (look up here) and filter interfaces from the access tokens and start a new discovery passing the access_token of the desired interface to the Discover function overload here for a search from level interface.
We do not have an Open function with a timeout. This should not be necessary anyway, as CVB raises an exception if the open fails after one try. And this should not take long.
Is there a simple “ping” using the DeviceId (not IP as DHCP is used) to check for a camera?
Our application controls the power to the camera and waits for the camera to be available ~5s (currently by Discover but it is too slow)…
Hi @IngFra
You need to use the token to open the camera. But you can use the given Cvb::DiscoveryInformation from Discover() to choose the right token based on some properties you can access without opening the camera.
e.g. you can access Cvb::DiscoveryProperties::DeviceUsername and Cvb::DiscoveryProperties::DeviceSerialNumber
An Example CVB++ code could look like this:
auto discoveryInformation = Cvb::DeviceFactory::Discover(Cvb::DiscoverFlags::IgnoreGevFD | Cvb::DiscoverFlags::IgnoreVins);
for (auto &deviceInfo : discoveryInformation)
{
std::string userName;
if (!deviceInfo.TryGetProperty(Cvb::DiscoveryProperties::DeviceUsername, userName))
{
std::cout << "no username readable for current device" << std::endl;
continue;
}
if (userName == "MyCameraName")
{
auto device_ = Cvb::DeviceFactory::Open<Cvb::GenICamDevice>(accessToken, Cvb::AcquisitionStack::GenTL);
break;
}
}