# API Device discovery with allow-broadcast-acknowledge / ignore-subnet

**URL:** <https://forum.commonvisionblox.com/t/api-device-discovery-with-allow-broadcast-acknowledge-ignore-subnet/1260>\
**Category:** Programming Questions\
**Tags:** discovery, python\
**Created:** [November 5, 2020, 3:10pm UTC](https://forum.commonvisionblox.com/t/api-device-discovery-with-allow-broadcast-acknowledge-ignore-subnet/1260 "2020-11-05T15:10:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rtp\_derahs](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/rtp_derahs/32/79_2.png) [@rtp\_derahs](https://forum.commonvisionblox.com/u/rtp_derahs)\
**Post date:** [November 9, 2020, 9:11am UTC](https://forum.commonvisionblox.com/t/api-device-discovery-with-allow-broadcast-acknowledge-ignore-subnet/1260/2 "2020-11-09T09:11:19Z")

</div>

Hi @michaelt 🙂

A quick example:

```cpp
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:

```cpp
auto mac = devsFound.at(0)[Cvb::Driver::DiscoveryProperties::DeviceMac];

```

Hope this helps!

---

_[View the full topic](https://forum.commonvisionblox.com/t/api-device-discovery-with-allow-broadcast-acknowledge-ignore-subnet/1260)._
