OpenXbox.SmartGlass 1.0.5

dotnet add package OpenXbox.SmartGlass --version 1.0.5
NuGet\Install-Package OpenXbox.SmartGlass -Version 1.0.5
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="OpenXbox.SmartGlass" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OpenXbox.SmartGlass --version 1.0.5
#r "nuget: OpenXbox.SmartGlass, 1.0.5"
#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 OpenXbox.SmartGlass as a Cake Addin
#addin nuget:?package=OpenXbox.SmartGlass&version=1.0.5

// Install OpenXbox.SmartGlass as a Cake Tool
#tool nuget:?package=OpenXbox.SmartGlass&version=1.0.5

Xbox One SmartGlass client library for .NET

Build Status Build status NuGet Discord

Build from source

cd xbox-smartglass-sharp
dotnet build

Command line tool

Print usage

dotnet run -p SmartGlass.Cli -- --help

API usage

Discover consoles

using SmartGlass;

IEnumerable<SmartGlass.Device> devices = await SmartGlass.Device.DiscoverAsync();

foreach (SmartGlass.Device device in devices)
{
    Console.WriteLine($"{device.Name} ({device.HardwareId}) {device.Address}");
}

Power on console

using SmartGlass;

string liveId = "FD0123456789";
SmartGlass.Device device = await SmartGlass.Device.PowerOnAsync(liveId);
Console.WriteLine($"{device.Name} ({device.HardwareId}) {device.Address}");

Connect to console

using SmartGlass;

SmartGlassClient client = null;

try
{
    client = await SmartGlassClient.ConnectAsync("192.168.0.234");
}
catch (SmartGlassException e)
{
    Console.WriteLine($"Failed to connect: {e.Message}");
}
catch (TimeoutException)
{
    Console.WriteLine($"Timeout while connecting");
}

Start Nano (gamestreaming)

using SmartGlass;
using SmartGlass.Channels;
using SmartGlass.Channels.Broadcast;
using SmartGlass.Common;
using SmartGlass.Nano;
using SmartGlass.Nano.Packets;

SmartGlassClient client = /* Connect to console */;

// Get general gamestream configuration
GamestreamConfiguration config = GamestreamConfiguration.GetStandardConfig();
/* Modify standard config, if desired */

GamestreamSession session = await client.BroadcastChannel.StartGamestreamAsync(config);

Console.WriteLine(
    $"Connecting to NANO // TCP: {session.TcpPort}, UDP: {session.UdpPort}");

NanoClient nano = new NanoClient(hostName, session);

// General Handshaking & Opening channels
await nano.InitializeProtocolAsync();

// Audio & Video client handshaking
// Sets desired AV formats
AudioFormat audioFormat = nano.AudioFormats[0];
VideoFormat videoFormat = nano.VideoFormats[0];
await nano.InitializeStreamAsync(audioFormat, videoFormat);

// Start ChatAudio channel
AudioFormat chatAudioFormat = new AudioFormat(1, 24000, AudioCodec.Opus);
await nano.OpenChatAudioChannelAsync(chatAudioFormat);

IConsumer consumer = /* initialize consumer */;
nano.AddConsumer(consumer);

// Start consumer, if necessary
consumer.Start();

// Tell console to start sending AV frames
await nano.StartStreamAsync();

// Start Controller input channel
await nano.OpenInputChannelAsync(1280, 720);

/* Run a mainloop, to gather controller input events or similar */

Project originally developed by Joel Day

Special thanks to Team OpenXbox for their contribution of documentation, tools and samples for the SmartGlass protocol.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 1,272 5/25/2019
1.0.4 1,285 12/12/2018
1.0.3 1,171 12/8/2018
1.0.2 1,235 12/2/2018
1.0.1 1,249 11/14/2018
1.0.0 1,264 11/12/2018