OnvifDiscovery 2.0.0
See the version list below for details.
dotnet add package OnvifDiscovery --version 2.0.0
NuGet\Install-Package OnvifDiscovery -Version 2.0.0
<PackageReference Include="OnvifDiscovery" Version="2.0.0" />
paket add OnvifDiscovery --version 2.0.0
#r "nuget: OnvifDiscovery, 2.0.0"
// 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
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 | Versions 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. |
-
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
|
Update target framework to .net6.0 and new DiscoverAsync methods