Skip to content

A support library for discovering Windows IoT Core devices on a network, just like the WinIoTCoreWatcher application.

License

Notifications You must be signed in to change notification settings

emmellsoft/WinIoTCoreListener

Repository files navigation

WinIoTCoreListener

A support library for discovering Windows IoT Core devices on a network, just like the WinIoTCoreWatcher application.

You can also get it as a NuGet package: https://www.nuget.org/packages/WinIoTCoreListener/

Example (the Program.cs file in a standard Console application):

using System;
using Laserbrain.WinIoTCoreListener.Lib;

namespace Laserbrain.WinIoTCoreListener.ConsoleExample
{
    internal static class Program
    {
        private static void Main()
        {
            using (IWinIotCoreListener winIotCoreListener = WinIotCoreListenerFactory.Create())
            {
                winIotCoreListener.OnDeviceInfoUpdated += (s, e) =>
                {
                    Console.WriteLine(e.UpdateStatus + ": " + e.DeviceInfo);
                };

                Console.WriteLine("Up'n'running. Press SPACE to list current devices and ESCAPE to exit!");

                while (true)
                {
                    switch (Console.ReadKey(true).Key)
                    {
                        case ConsoleKey.Spacebar:
                            Console.WriteLine("-------------------------");
                            foreach (DeviceInfo deviceInfo in winIotCoreListener.DeviceInfos)
                            {
                                Console.WriteLine("* " + deviceInfo);
                            }
                            Console.WriteLine("-------------------------");
                            break;

                        case ConsoleKey.Escape:
                            return;
                    }
                }
            }
        }
    }
}

About

A support library for discovering Windows IoT Core devices on a network, just like the WinIoTCoreWatcher application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published