IDeviceClient
namespace AR51.Net;
public interface IDeviceClient
The apps and devices connected to the AR 51 system: headsets, Unity and Unreal apps, phones and Mocap Studio. Use it through IAR51Client.Devices. Read-only.
Devices follows the system live; all members are safe to use from any thread.
How-to
This page is reference (facts only). For a walkthrough with a complete sample, see the Devices guide.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
Devices | IReadOnlyList<DeviceInfo> | get | The connected devices. Empty while not connected. |
Events
Standard .NET events (EventHandler<T>): subscribe with +=, unsubscribe with -=. They are raised on a background thread.
| Event | Args | Raised when |
|---|---|---|
DevicesChanged | DevicesChangedEventArgs | Raised when a device connects or disconnects, or a battery level changes. Raised on a background thread. Battery levels are refreshed about every 10 seconds. |
Example
ar51.Devices.DevicesChanged += (_, e) =>
{
foreach (DeviceInfo device in e.Added) Console.WriteLine($"+ {device.Name} ({device.Platform})");
foreach (DeviceInfo device in e.Removed) Console.WriteLine($"- {device.Name}");
};
Related types
Small types used by this interface, documented here.
DeviceInfo
record · sealedpublic sealed record DeviceInfo(string Id, string Name, string Host, DeviceType Type, DevicePlatform Platform, int? BatteryPercent);
A device connected to the AR 51 system.
| Property | Type | Description |
|---|---|---|
Id | string | The device's unique id. A skeleton's Skeleton.DeviceId names the headset its person wears. |
Name | string | The device's name, for example "Quest 3 - Player 2". |
Host | string | The device's IP address. |
Type | DeviceType | The kind of device. |
Platform | DevicePlatform | The exact platform. |
BatteryPercent | int? | Battery level from 0 to 100, or null when the device does not report it. |
DeviceType
enumpublic enum DeviceType
The kind of a connected device.
| Value | Meaning |
|---|---|
Computer = 0 | A computer running an AR 51 app (Unity or Unreal). |
Headset = 1 | A VR, AR or mixed reality headset. |
Phone = 2 | A phone or tablet. |
MocapStudio = 3 | AR 51 Mocap Studio. |
DevicePlatform
enumpublic enum DevicePlatform
The platform of a connected device.
| Value | Meaning |
|---|---|
Pc = 0 | A Windows, Linux or macOS computer. |
HoloLens = 1 | Microsoft HoloLens. |
HoloLens2 = 2 | Microsoft HoloLens 2. |
Android = 3 | An Android phone or tablet. |
MagicLeap = 4 | Magic Leap. |
OculusRift = 5 | Oculus Rift. |
MetaQuest = 6 | Meta Quest, running stand-alone. |
HtcVive = 7 | HTC Vive. |
OpenXrTethered = 8 | An OpenXR headset tethered to a computer. |
OpenXrMobile = 9 | A stand-alone OpenXR headset. |
PicoNeo3Pro = 10 | Pico Neo 3 Pro. |
MetaQuestLink = 11 | Meta Quest tethered to a computer (Quest Link). |
HtcFocus3 = 12 | HTC Vive Focus 3. |
MocapStudioWindows = 13 | Mocap Studio on Windows. |
MocapStudioLinux = 14 | Mocap Studio on Linux. |
MocapStudioMac = 15 | Mocap Studio on macOS. |
DevicesChangedEventArgs
class · sealedpublic sealed class DevicesChangedEventArgs : EventArgs
Data for IDeviceClient.DevicesChanged.
| Property | Type | Access | Description |
|---|---|---|---|
Added | IReadOnlyList<DeviceInfo> | get | Devices that connected. |
Removed | IReadOnlyList<DeviceInfo> | get | Devices that disconnected. |
Devices | IReadOnlyList<DeviceInfo> | get | Every connected device after the change, with current battery levels. |
Constructor
public DevicesChangedEventArgs(IReadOnlyList<DeviceInfo> added, IReadOnlyList<DeviceInfo> removed, IReadOnlyList<DeviceInfo> devices);
Creates the event data.
See also
- Devices guide — walkthrough with a complete, compiled sample
- Class index — every AR51.Net type
- Data conventions, threading and errors
Was this page helpful?