# Open camera without using a broadcast message

**URL:** https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540
**Category:** C++ API
**Created:** [November 4, 2021, 4:51pm UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540 "2021-11-04T16:51:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![PaRo](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@PaRo](https://forum.commonvisionblox.com/u/PaRo)
#### Post date: [November 4, 2021, 4:51pm UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540/1 "2021-11-04T16:51:53Z")

</div>

Hi,

I’m using the C++ CVB API to capture video from a GigE Vision camera.

Cvb::DeviceFactory::Discover() is sending a broadcast Discovery Command.

As the IP address of the camera is known, is there a way to open it without sending a broadcast message ?

---

<div class="post-metadata">

### Author: ![Chris](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/chris/32/1154_2.png) [@Chris](https://forum.commonvisionblox.com/u/Chris)
#### Post date: [November 5, 2021, 9:30am UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540/2 "2021-11-05T09:30:29Z")

</div>

Hi @PaRo

have you tried configuring the camera in the GenICam browser and simply loading the driver in your code?

```cpp
auto path = Cvb::InstallPath(); 
path += CVB_LIT("drivers/GenICam.vin"); 
auto device = DeviceFactory::Open(path); 

```

Not sure if this works without broadcast but I would think so…

Cheers  
Chris

---

<div class="post-metadata">

### Author: ![PaRo](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@PaRo](https://forum.commonvisionblox.com/u/PaRo)
#### Post date: [November 5, 2021, 12:47pm UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540/3 "2021-11-05T12:47:54Z")

</div>

Thank you for your answer Chris.

I’ve already tried this method and it was still sending a broadcast message.

---

<div class="post-metadata">

### Author: ![Chris](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/chris/32/1154_2.png) [@Chris](https://forum.commonvisionblox.com/u/Chris)
#### Post date: [November 5, 2021, 1:00pm UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540/4 "2021-11-05T13:00:30Z")

</div>

Maybe this snippet is what you are looking for, here the broadcastdiscovery is disabled on the interface bevore discovering:

````cpp
// Discover all interfaces 

auto allInterfaceFlags = Cvb::Driver::DiscoverFlags::UpToLevelInterface | Cvb::Driver::DiscoverFlags::IgnoreGevSD; 

auto allInterfaces = Cvb::DeviceFactory::Discover(allInterfaceFlags);  

for (auto& iface : allInterfaces) 
{ 
// Broadcast discover on each interface to find every device, even devices in the wrong subnet: 
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 allDevices = Cvb::DeviceFactory::Discover(iface, allDevFlags); 

for (auto& device : allDevices) 
{ 
// Check if camera is accessible: 
// device[Cvb::Driver::DiscoveryProperties::DeviceAccessStatus];  

// Work with camera. e.g. open it: 
// auto cam = Cvb::DeviceFactory::Open(device.AccessToken()); 

} 
} 
```cpp

Just notice, you dont want to ignore the gevSD on ubuntu machines as there is no filter driver.
On windows we prefer working with the FD thus we ignore the SD when discovering. On ubuntu you wont find any devices when doing so.
````

---

<div class="post-metadata">

### Author: ![PaRo](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@PaRo](https://forum.commonvisionblox.com/u/PaRo)
#### Post date: [November 5, 2021, 6:04pm UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540/5 "2021-11-05T18:04:46Z")

</div>

It seems it is still sending a broadcast discovery command with this one too.

I really don’t know how to avoid that

---

<div class="post-metadata">

### Author: ![Chris](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/chris/32/1154_2.png) [@Chris](https://forum.commonvisionblox.com/u/Chris)
#### Post date: [November 8, 2021, 7:36am UTC](https://forum.commonvisionblox.com/t/open-camera-without-using-a-broadcast-message/1540/6 "2021-11-08T07:36:45Z")

</div>

Hi @PaRo

I had a short chat with one of my colleagues and unfortunately have to tell you, that there is no way to avoid the Broadcast.  
The reason is, that there was no need so far, as the Broadcast itself is not really putting any load to the network.

Cheers  
Chris
