Hi @michaelt
A quick example:
auto allInterfaceFlags = Cvb::Driver::DiscoverFlags::UpToLevelInterface | Cvb::Driver::DiscoverFlags::IgnoreGevSD;
auto allInterfaces = Cvb::DeviceFactory::Discover(allInterfaceFlags);
// Let's say your camera is connected to the 4th interface found:
Cvb::Driver::DiscoveryInformation& iface = allInterfaces.at(4);
auto allDevFlags = Cvb::Driver::DiscoverFlags::IgnoreVins | Cvb::Driver::DiscoverFlags::IncludeInaccessible;// | Cvb::Driver::DiscoverFlags::IgnoreGevSD;
iface.SetGenApiFeature("TLInterface", "DisableSubnetMatch", "1");
iface.SetGenApiFeature("TLInterface", "AllowBroadcastDiscoveryResponse", "1");
auto devsFound = Cvb::DeviceFactory::Discover(iface, allDevFlags);
//std::cout << iface[Cvb::Driver::DiscoveryProperties::InterfaceId] << std::endl;
if (devsFound.size() > 0)
{
auto interfaceDevice = Cvb::DeviceFactory::Open(iface.AccessToken());
auto interfaceNM = interfaceDevice->NodeMap(CVB_LIT("TLInterface"));
auto deviceUpdateListNode = interfaceNM->Node<Cvb::CommandNode>(CVB_LIT("DeviceUpdateList"));
auto cfgIPNode = interfaceNM->Node<Cvb::IntegerNode>(CVB_LIT("IPCfg_IP"));
auto cfgSubnetNode = interfaceNM->Node<Cvb::IntegerNode>(CVB_LIT("IPCfg_Subnet"));
auto cfgMacNode = interfaceNM->Node<Cvb::IntegerNode>(CVB_LIT("IPCfg_MAC"));
auto cfgForceNode = interfaceNM->Node<Cvb::CommandNode>(CVB_LIT("IPCfg_SetForceIP"));
auto cfgStaticNode = interfaceNM->Node<Cvb::CommandNode>(CVB_LIT("IPCfg_SetStatIP"));
// make node map aware of the device
deviceUpdateListNode->Execute();
// we want to configure the found device with MAC
// 00-01-0D-C2-43-66
int64_t mac = 0x00010dc24366;
int64_t macReverse = 0x6643c20d0100;
cfgMacNode->SetValue(macReverse);
// New IP 169.254.0.1
cfgIPNode->SetValue(0xa9fe0001);
// Subnet 255.255.0.0
cfgSubnetNode->SetValue(0xFFFF0000);
// Force the new IP
cfgForceNode->Execute();
// make node map aware of new IP
deviceUpdateListNode->Execute();
// permanently write the IP to the camera
cfgStaticNode->Execute();
}
You can read some information like the MAC etc. from an camera in the wrone subnet like so:
auto mac = devsFound.at(0)[Cvb::Driver::DiscoveryProperties::DeviceMac];
Hope this helps!