OnvifDiscovery 2.0.0

dotnet add package OnvifDiscovery --version 2.0.0
NuGet\Install-Package OnvifDiscovery -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OnvifDiscovery" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OnvifDiscovery --version 2.0.0
#r "nuget: OnvifDiscovery, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OnvifDiscovery as a Cake Addin
#addin nuget:?package=OnvifDiscovery&version=2.0.0

// Install OnvifDiscovery as a Cake Tool
#tool nuget:?package=OnvifDiscovery&version=2.0.0

Onvif Discovery

NuGet version (OnvifDiscovery) Build Status Quality Gate Status Coverage Code Smells

OnvifDiscovery is a simple cross-platform .NET library to discover ONVIF compliant devices.

Getting started

OnvifDiscovery sends a probe message to all available network interfaces and waits the timeout specified in order to get the list of discovered onvif devices that replied to the probe message.

To use the library install and add a reference of the OnvifDiscovery nuget package, then call the discover method like the following sample:

// add the using
using OnvifDiscovery;

// Create a Discovery instance
var onvifDiscovery = new Discovery ();

// Call the asynchronous method DiscoverAsync that returns IAsyncEnumerable
// with a timeout of 1 second
await foreach (var device in discovery.DiscoverAsync(1, cancellationToken))
{
    // New device discovered
}

Finally, you can also use the DiscoverAsync method by passing a ChannelWriter<DiscoveryDevice>, the method will write to the channel devices as soon as they are discovered:

// add the using
using OnvifDiscovery;

// Create a Discovery instance
var onvifDiscovery = new Discovery ();

// You can call Discover with a ChannelWriter and CancellationToken
CancellationTokenSource cancellation = new CancellationTokenSource ();
var channel = Channel.CreateUnbounded<DiscoveryDevice>();

var discoverTask = onvifDiscovery.DiscoverAsync(channel.Writer, 1, cancellationToken);
await foreach (var device in channel.Reader.ReadAllAsync(cancellationToken))
{
    // New device discovered
}

Obsolete methods from version 1.X

When you update to version 2 you can see that previous available methods are marked as obsolete. Please use the new methods explained above as they have better support for asynchronous programming.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on OnvifDiscovery:

Repository Stars
genielabs/HomeGenie
HomeGenie, the programmable automation intelligence
Version Downloads Last updated
2.0.0 3,741 10/11/2023
1.2.2 5,140 2/16/2022
1.2.1 886 2/9/2022
1.2.0 835 1/8/2022
1.1.0 39,968 6/7/2020
1.0.1 1,265 12/3/2019

Update target framework to .net6.0 and new DiscoverAsync methods