Skip to content

Class DeviceConnection

Namespace: Belay.Core
Assembly: Belay.Core.dll

Simplified device connection that handles both serial and subprocess communication. Uses only basic Raw REPL protocol per aggressive simplification strategy.

csharp
public sealed class DeviceConnection : IDisposable

Inheritance

objectDeviceConnection

Implements

IDisposable

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

DeviceConnection(ConnectionType, string, ILogger<DeviceConnection>)

Initializes a new instance of the class.

Fields

ConnectionString

Type

Properties

State

Methods

ConnectAsync(CancellationToken)

Connects to the device.

DisconnectAsync(CancellationToken)

Disconnects from the device.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ExecuteAsync(string, CancellationToken)

Executes Python code on the device using basic Raw REPL protocol.

ExecuteAsync<T>(string, CancellationToken)

Executes code and returns typed result (simplified generic version).

GetFileAsync(string, CancellationToken)

Simplified file download - basic implementation.

PutFileAsync(string, string, CancellationToken)

Simplified file upload - basic implementation.

OutputReceived

StateChanged

Released under the Apache License 2.0.