Class DeviceService
Connects to a server to receive information on all
Implements
Namespace: Unity.DigitalTwins.Live.Sdk.Services.Implementations
Assembly: solution.dll
Syntax
public class DeviceService : IDeviceService, IDisposable
Constructors
DeviceService(EnvironmentSettings, IServiceHttpClientWrapper, ISignalBus)
Creates an instance of DeviceService.
Declaration
public DeviceService(EnvironmentSettings environmentSettings, IServiceHttpClientWrapper serviceHttpClientWrapper, ISignalBus signalBus)
Parameters
| Type | Name | Description |
|---|---|---|
| EnvironmentSettings | environmentSettings | The EnvironmentSettings instance. |
| IServiceHttpClientWrapper | serviceHttpClientWrapper |
|
| ISignalBus | signalBus | The instance of ISignalBus. |
Methods
Dispose()
Clean-up code that releases resources.
Declaration
public void Dispose()
FireLiveDeviceUpdated(LiveDevice)
Fires an event when a
Declaration
public void FireLiveDeviceUpdated(LiveDevice liveDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| LiveDevice | liveDevice | The |
GetCachedDevices()
Retrieves all cached
Declaration
public IEnumerable<LiveDevice> GetCachedDevices()
Returns
| Type | Description |
|---|---|
| IEnumerable<LiveDevice> | Returns a list of all |
GetDevicesAsync()
Gets all devices
Declaration
public async Task<IEnumerable<LiveDevice>> GetDevicesAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<LiveDevice>> |
GetSelectedLiveDevices()
Retrieves all selected
Declaration
public IEnumerable<LiveDevice> GetSelectedLiveDevices()
Returns
| Type | Description |
|---|---|
| IEnumerable<LiveDevice> | Returns a list of all selected |
TryGetLiveDevice(String, out LiveDevice)
Retrieves a
Declaration
public bool TryGetLiveDevice(string deviceId, out LiveDevice liveDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| String | deviceId | The ID used to retrieve the |
| LiveDevice | liveDevice | The returned |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if the operation is successful. |