Table of Contents

Class BaseCommandConnection

Namespace
DuetAPIClient
Assembly
DuetAPIClient.dll

Base connection class for sending commands to the control server

public abstract class BaseCommandConnection : BaseConnection, IDisposable
Inheritance
BaseCommandConnection
Implements
Derived
Inherited Members

Remarks

Protected constructor for derived modes that can issue regular commands

Constructors

BaseCommandConnection(ConnectionMode)

Base connection class for sending commands to the control server

protected BaseCommandConnection(ConnectionMode mode)

Parameters

mode ConnectionMode

Connection type

Remarks

Protected constructor for derived modes that can issue regular commands

See Also

Methods

AddHttpEndpoint(HttpEndpointType, string, string, bool, int)

Add a new third-party HTTP endpoint in the format /machine/{ns}/{path}

public HttpEndpointUnixSocket AddHttpEndpoint(HttpEndpointType endpointType, string ns, string path, bool isUploadRequest = false, int backlog = 4)

Parameters

endpointType HttpEndpointType

HTTP request type

ns string

Namespace of the plugin

path string

Endpoint path

isUploadRequest bool

Whether this is an upload request

backlog int

Number of simultaneously pending connections

Returns

HttpEndpointUnixSocket

Wrapper around the UNIX socket for accepting HTTP endpoint requests

Exceptions

ArgumentException

Endpoint namespace is reserved

InvalidOperationException

Endpoint is already in use

IOException

UNIX socket could not be opened

SocketException

Command could not be processed

See Also

AddHttpEndpointAsync(HttpEndpointType, string, string, bool, int, CancellationToken)

Add a new third-party HTTP endpoint in the format /machine/{ns}/{path}

public Task<HttpEndpointUnixSocket> AddHttpEndpointAsync(HttpEndpointType endpointType, string ns, string path, bool isUploadRequest = false, int backlog = 4, CancellationToken cancellationToken = default)

Parameters

endpointType HttpEndpointType

HTTP request type

ns string

Namespace of the plugin

path string

Endpoint path

isUploadRequest bool

Whether this is an upload request

backlog int

Number of simultaneously pending connections

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<HttpEndpointUnixSocket>

Wrapper around the UNIX socket for accepting HTTP endpoint requests

Exceptions

ArgumentException

Endpoint namespace is reserved

InvalidOperationException

Endpoint is already in use

IOException

UNIX socket could not be opened

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

AddUserSession(AccessLevel, SessionType, string?)

Add a new user session

public int AddUserSession(AccessLevel access, SessionType type, string? origin = null)

Parameters

access AccessLevel

Access level of this session

type SessionType

Type of this session

origin string

Origin of the user session (e.g. IP address or PID)

Returns

int

New session ID

Exceptions

SocketException

Command could not be processed

See Also

AddUserSessionAsync(AccessLevel, SessionType, string?, CancellationToken)

Add a new user session asynchronously

public Task<int> AddUserSessionAsync(AccessLevel access, SessionType type, string? origin = null, CancellationToken cancellationToken = default)

Parameters

access AccessLevel

Access level of this session

type SessionType

Type of this session

origin string

Origin of the user session (e.g. IP address or PID)

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<int>

New session ID

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

CheckPassword(string)

Check the given password (see M551)

public bool CheckPassword(string password)

Parameters

password string

Password to check

Returns

bool

True if the requested password is correct

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

CheckPasswordAsync(string, CancellationToken)

Check the given password asynchronously (see M551)

public Task<bool> CheckPasswordAsync(string password, CancellationToken cancellationToken = default)

Parameters

password string

Password to check

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<bool>

True if the requested password is correct

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

EvaluateExpression(string, CodeChannel)

Evaluate an arbitrary expression

public JsonElement EvaluateExpression(string expression, CodeChannel channel = CodeChannel.SBC)

Parameters

expression string

Expression to evaluate

channel CodeChannel

Context of the evaluation

Returns

JsonElement

Evaluation result

Exceptions

InvalidOperationException

Requested code channel is disabled

JsonException

Expected and returned data type do not match

SocketException

Command could not be processed

See Also

EvaluateExpressionAsync(string, CodeChannel, CancellationToken)

Evaluate an arbitrary expression asynchronously

public Task<JsonElement> EvaluateExpressionAsync(string expression, CodeChannel channel = CodeChannel.SBC, CancellationToken cancellationToken = default)

Parameters

expression string

Expression to evaluate

channel CodeChannel

Context of the evaluation

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<JsonElement>

Evaluation result

Exceptions

InvalidOperationException

Requested code channel is disabled

JsonException

Expected and returned data type do not match

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

Flush(CodeChannel)

Wait for all pending codes of the given channel to finish

public bool Flush(CodeChannel channel)

Parameters

channel CodeChannel

Code channel to wait for

Returns

bool

True if all pending codes could be flushed

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

FlushAsync(CodeChannel, CancellationToken)

Wait for all pending codes of the given channel to finish asynchronously

public Task<bool> FlushAsync(CodeChannel channel, CancellationToken cancellationToken = default)

Parameters

channel CodeChannel

Code channel to wait for

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<bool>

True if all pending codes could be flushed

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

GetFileInfo(string)

Parse a G-code file and returns file information about it

public GCodeFileInfo GetFileInfo(string fileName)

Parameters

fileName string

The file to parse

Returns

GCodeFileInfo

Information about the parsed file

Exceptions

SocketException

Command could not be processed

See Also

GetFileInfo(string, bool)

Parse a G-code file and returns file information about it

public GCodeFileInfo GetFileInfo(string fileName, bool readThumbnailContent)

Parameters

fileName string

The file to parse

readThumbnailContent bool

Whether thumbnail content shall be returned

Returns

GCodeFileInfo

Information about the parsed file

Exceptions

SocketException

Command could not be processed

See Also

GetFileInfoAsync(string, bool, CancellationToken)

Parse a G-code file and returns file information about it asynchronously

public Task<GCodeFileInfo> GetFileInfoAsync(string fileName, bool readThumbnailContent, CancellationToken cancellationToken = default)

Parameters

fileName string

The file to parse

readThumbnailContent bool

Whether thumbnail content shall be returned

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<GCodeFileInfo>

Information about the parsed file

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

GetFileInfoAsync(string, CancellationToken)

Parse a G-code file and returns file information about it asynchronously

public Task<GCodeFileInfo> GetFileInfoAsync(string fileName, CancellationToken cancellationToken = default)

Parameters

fileName string

The file to parse

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<GCodeFileInfo>

Information about the parsed file

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

GetObjectModel()

Retrieve the full object model of the machine. In subscription mode this is the first command that has to be called once a connection has been established

public ObjectModel GetObjectModel()

Returns

ObjectModel

The current machine model

Exceptions

SocketException

Command could not be processed

See Also

GetObjectModelAsync(CancellationToken)

Retrieve the full object model of the machine asynchronously. In subscription mode this is the first command that has to be called once a connection has been established

public Task<ObjectModel> GetObjectModelAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<ObjectModel>

The current machine model

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

GetSerializedObjectModel()

Optimized method to directly query the machine model JSON

public string GetSerializedObjectModel()

Returns

string

Machine model JSON

Exceptions

SocketException

Command could not be processed

See Also

GetSerializedObjectModelAsync(CancellationToken)

Optimized method to directly query the machine model JSON

public Task<string> GetSerializedObjectModelAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Machine model JSON

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

InstallPlugin(string)

Install or upgrade a plugin

public void InstallPlugin(string packageFile)

Parameters

packageFile string

Absolute file path to the plugin ZIP bundle

Exceptions

SocketException

Command could not be processed

See Also

InstallPluginAsync(string, CancellationToken)

Install or upgrade a plugin asynchronously

public Task InstallPluginAsync(string packageFile, CancellationToken cancellationToken = default)

Parameters

packageFile string

Absolute file path to the plugin ZIP bundle

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

InstallSystemPackage(string)

Install or upgrade a system package

public void InstallSystemPackage(string packageFile)

Parameters

packageFile string

Absolute file path to the package file

Exceptions

SocketException

Command could not be processed

See Also

InstallSystemPackageAsync(string, CancellationToken)

Install or upgrade a system package asynchronously

public Task InstallSystemPackageAsync(string packageFile, CancellationToken cancellationToken = default)

Parameters

packageFile string

Absolute file path to the package file

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

InvalidateChannel(CodeChannel)

Invalidate all pending codes and files on the given channel

public void InvalidateChannel(CodeChannel channel)

Parameters

channel CodeChannel

Code channel where everything is supposed to be invalidated

Remarks

This does NOT cancel the current code being executed by RRF!

Exceptions

SocketException

Command could not be processed

See Also

InvalidateChannelAsync(CodeChannel, CancellationToken)

Invalidate all pending codes and files on the given channel

public Task InvalidateChannelAsync(CodeChannel channel, CancellationToken cancellationToken = default)

Parameters

channel CodeChannel

Code channel where everything is supposed to be invalidated

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Remarks

This does NOT cancel the current code being executed by RRF!

Exceptions

SocketException

Command could not be processed

See Also

LockObjectModel()

Lock the machine model for read/write access

public BaseCommandConnection.ObjectModelLock LockObjectModel()

Returns

BaseCommandConnection.ObjectModelLock

Asynchronous object model lock

Exceptions

SocketException

Command could not be processed

See Also

LockObjectModelAsync(CancellationToken)

Lock the machine model for read/write access asynchronously

public Task<BaseCommandConnection.ObjectModelLock> LockObjectModelAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<BaseCommandConnection.ObjectModelLock>

Asynchronous object model lock

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

NotifyPluginStarted(string?)

Notify the control server that a plugin has been started

public void NotifyPluginStarted(string? plugin = null)

Parameters

plugin string

Plugin ID (only needed if running as root)

Exceptions

SocketException

Command could not be processed

NotifyPluginStartedAsync(string?, CancellationToken)

Notify the control server that a plugin has been started

public Task NotifyPluginStartedAsync(string? plugin = null, CancellationToken cancellationToken = default)

Parameters

plugin string

Plugin ID (only needed if running as root)

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

PatchObjectModel(string, JsonElement)

Apply a full patch to the object model. Use with care!

public void PatchObjectModel(string key, JsonElement patch)

Parameters

key string

Key to update

patch JsonElement

Patch to apply

Exceptions

SocketException

Command could not be processed

See Also

PatchObjectModelAsync(string, JsonElement, CancellationToken)

Apply a full patch to the object model asynchronously. Use with care!

public Task PatchObjectModelAsync(string key, JsonElement patch, CancellationToken cancellationToken = default)

Parameters

key string

Key to update

patch JsonElement

Patch to apply

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

PerformCode(Code)

Execute an arbitrary pre-parsed code

public Message PerformCode(Code code)

Parameters

code Code

The code to execute

Returns

Message

Result of the given code

Remarks

Cancelling the read operation does not cancel the code execution

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

PerformCodeAsync(Code, CancellationToken)

Execute an arbitrary pre-parsed code asynchronously

public Task<Message> PerformCodeAsync(Code code, CancellationToken cancellationToken = default)

Parameters

code Code

The code to execute

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<Message>

Result of the given code

Remarks

Cancelling the read operation does not cancel the code execution

Exceptions

InvalidOperationException

Requested code channel is disabled

OperationCanceledException

Code or operation has been cancelled

SocketException

Command could not be processed

See Also

PerformSimpleCode(string, CodeChannel)

Execute an arbitrary G/M/T-code in text form and return the result as a string

public string PerformSimpleCode(string code, CodeChannel channel = CodeChannel.SBC)

Parameters

code string

The code to execute

channel CodeChannel

Optional destination channel of this code

Returns

string

Result of the given code converted to a string

Remarks

Cancelling the read operation does not cancel the code execution

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

PerformSimpleCode(string, CodeChannel, bool)

Execute an arbitrary G/M/T-code in text form and return the result as a string

public string PerformSimpleCode(string code, CodeChannel channel, bool executeAsynchronously)

Parameters

code string

The code to execute

channel CodeChannel

Optional destination channel of this code

executeAsynchronously bool

Execute this code asynchronously in the background

Returns

string

Result of the given code converted to a string

Remarks

Cancelling the read operation does not cancel the code execution

Exceptions

InvalidOperationException

Requested code channel is disabled

SocketException

Command could not be processed

See Also

PerformSimpleCodeAsync(string, CodeChannel, bool, CancellationToken)

Execute an arbitrary G/M/T-code in text form and return the result as a string asynchronously

public Task<string> PerformSimpleCodeAsync(string code, CodeChannel channel, bool executeAsynchronously, CancellationToken cancellationToken = default)

Parameters

code string

The code to execute

channel CodeChannel

Optional destination channel of this code

executeAsynchronously bool

Execute this code asynchronously in the background

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Result of the given code converted to a string

Remarks

Cancelling the read operation does not cancel the code execution

Exceptions

InvalidOperationException

Requested code channel is disabled

OperationCanceledException

Code or operation has been cancelled

SocketException

Command could not be processed

See Also

PerformSimpleCodeAsync(string, CodeChannel, CancellationToken)

Execute an arbitrary G/M/T-code in text form and return the result as a string asynchronously

public Task<string> PerformSimpleCodeAsync(string code, CodeChannel channel = CodeChannel.SBC, CancellationToken cancellationToken = default)

Parameters

code string

The code to execute

channel CodeChannel

Optional destination channel of this code

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Result of the given code converted to a string

Remarks

Cancelling the read operation does not cancel the code execution

Exceptions

InvalidOperationException

Requested code channel is disabled

OperationCanceledException

Code or operation has been cancelled

SocketException

Command could not be processed

See Also

QueryObjectModel(string, string)

Query the object model using a key and flags, returning a response compatible with M409 format

public JsonElement QueryObjectModel(string key, string flags)

Parameters

key string

Object model key path (e.g. "heat", "move.axes")

flags string

RRF-compatible flags string (e.g. "f", "fn", "d99vn")

Returns

JsonElement

JSON response

Exceptions

SocketException

Command could not be processed

See Also

QueryObjectModelAsync(string, string, CancellationToken)

Query the object model using a key and flags, returning a response compatible with M409 format

public Task<JsonElement> QueryObjectModelAsync(string key, string flags, CancellationToken cancellationToken = default)

Parameters

key string

Object model key path (e.g. "heat", "move.axes")

flags string

RRF-compatible flags string (e.g. "f", "fn", "d99vn")

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<JsonElement>

JSON response

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

ReloadPlugin(string)

Reload a plugin manifest

public void ReloadPlugin(string plugin)

Parameters

plugin string

Identifier of the plugin

Exceptions

SocketException

Command could not be processed

See Also

ReloadPluginAsync(string, CancellationToken)

Reload a plugin manifest

public Task ReloadPluginAsync(string plugin, CancellationToken cancellationToken = default)

Parameters

plugin string

Identifier of the plugin

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

RemoveHttpEndpoint(HttpEndpointType, string, string)

Remove an existing HTTP endpoint

public bool RemoveHttpEndpoint(HttpEndpointType endpointType, string ns, string path)

Parameters

endpointType HttpEndpointType

Type of the endpoint to remove

ns string

Namespace of the endpoint to remove

path string

Endpoint to remove

Returns

bool

True if the endpoint could be removed

Exceptions

SocketException

Command could not be processed

See Also

RemoveHttpEndpointAsync(HttpEndpointType, string, string, CancellationToken)

Remove an existing HTTP endpoint

public Task<bool> RemoveHttpEndpointAsync(HttpEndpointType endpointType, string ns, string path, CancellationToken cancellationToken = default)

Parameters

endpointType HttpEndpointType

Type of the endpoint to remove

ns string

Namespace of the endpoint to remove

path string

Endpoint to remove

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<bool>

True if the endpoint could be removed

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

RemoveUserSession(int)

Remove an existing user session

public bool RemoveUserSession(int id)

Parameters

id int

Identifier of the session

Returns

bool

True if the session could be removed

Exceptions

SocketException

Command could not be processed

See Also

RemoveUserSessionAsync(int, CancellationToken)

Remove an existing user session asynchronously

public Task<bool> RemoveUserSessionAsync(int id, CancellationToken cancellationToken = default)

Parameters

id int

Identifier of the session

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<bool>

True if the session could be removed

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

ResolvePath(string)

Resolve a RepRapFirmware-style file path to a real file path

public string ResolvePath(string path)

Parameters

path string

File path to resolve

Returns

string

Resolved file path

Exceptions

SocketException

Command could not be processed

See Also

ResolvePath(string, FileDirectory)

Resolve a RepRapFirmware-style file path to a real file path

public string ResolvePath(string path, FileDirectory baseDirectory)

Parameters

path string

File path to resolve

baseDirectory FileDirectory

Base directory to resolve the path relative to

Returns

string

Resolved file path

Exceptions

SocketException

Command could not be processed

See Also

ResolvePathAsync(string, FileDirectory, CancellationToken)

Resolve a RepRapFirmware-style file path to a real file path asynchronously

public Task<string> ResolvePathAsync(string path, FileDirectory baseDirectory, CancellationToken cancellationToken = default)

Parameters

path string

File path to resolve

baseDirectory FileDirectory

Base directory to resolve the path relative to

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Resolved file path

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

ResolvePathAsync(string, CancellationToken)

Resolve a RepRapFirmware-style file path to a real file path asynchronously

public Task<string> ResolvePathAsync(string path, CancellationToken cancellationToken = default)

Parameters

path string

File path to resolve

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Resolved file path

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

SetObjectModel(string, string)

Set a given property to a certain value. Make sure to lock the object model before calling this

public bool SetObjectModel(string path, string value)

Parameters

path string

Path to the property

value string

New value as string

Returns

bool

True if the property could be updated

Exceptions

SocketException

Command could not be processed

See Also

SetObjectModelAsync(string, string, CancellationToken)

Set a given property to a certain value. Make sure to lock the object model before calling this

public Task<bool> SetObjectModelAsync(string path, string value, CancellationToken cancellationToken = default)

Parameters

path string

Path to the property

value string

New value as string

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<bool>

True if the property could be updated

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

SetPluginData(string, JsonElement, string?)

Set custom plugin data in the object model

public void SetPluginData(string key, JsonElement value, string? plugin = null)

Parameters

key string

Key to set

value JsonElement

Value to set

plugin string

Identifier of the plugin to update (optional)

Exceptions

SocketException

Command could not be processed

UnauthorizedAccessException

Insufficient permissions to modify other plugin data

See Also

SetPluginDataAsync(string, JsonElement, string?, CancellationToken)

Set custom plugin data in the object model asynchronously

public Task SetPluginDataAsync(string key, JsonElement value, string? plugin = null, CancellationToken cancellationToken = default)

Parameters

key string

Key to set

value JsonElement

Value to set

plugin string

Identifier of the plugin to update (optional)

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

UnauthorizedAccessException

Insufficient permissions to modify other plugin data

See Also

SetUpdateStatus(bool)

Override the current machine status if a software update is in progress

public void SetUpdateStatus(bool isUpdating)

Parameters

isUpdating bool

If the machine status is supposed to be overrridden

Remarks

The object model must not be locked when this is called

Exceptions

SocketException

Command could not be processed

UnauthorizedAccessException

Insufficient permissions to modify other plugin data

See Also

SetUpdateStatusAsync(bool, CancellationToken)

Override the current machine status asynchronously if a software update is in progress

public Task SetUpdateStatusAsync(bool isUpdating, CancellationToken cancellationToken = default)

Parameters

isUpdating bool

If the machine status is supposed to be overrridden

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Remarks

The object model must not be locked when this is called

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

UnauthorizedAccessException

Insufficient permissions to modify other plugin data

See Also

StartPlugin(string)

Start a plugin

public void StartPlugin(string plugin)

Parameters

plugin string

Identifier of the plugin

Exceptions

SocketException

Command could not be processed

See Also

StartPluginAsync(string, CancellationToken)

Start a plugin asynchronously

public Task StartPluginAsync(string plugin, CancellationToken cancellationToken = default)

Parameters

plugin string

Identifier of the plugin

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

StopPlugin(string)

Stop a plugin

public void StopPlugin(string plugin)

Parameters

plugin string

Identifier of the plugin

Exceptions

SocketException

Command could not be processed

See Also

StopPluginAsync(string, CancellationToken)

Stop a plugin asynchronously

public Task StopPluginAsync(string plugin, CancellationToken cancellationToken = default)

Parameters

plugin string

Identifier of the plugin

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

SyncObjectModel()

Wait for the full object model to be updated from RepRapFirmware

public void SyncObjectModel()

Exceptions

SocketException

Command could not be processed

See Also

SyncObjectModelAsync(CancellationToken)

Wait asynchronously for the full object model to be updated from RepRapFirmware

public Task SyncObjectModelAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

UninstallPlugin(string)

Uninstall a plugin

public void UninstallPlugin(string plugin)

Parameters

plugin string

Identifier of the plugin

Exceptions

SocketException

Command could not be processed

See Also

UninstallPluginAsync(string, CancellationToken)

Uninstall a plugin asynchronously

public Task UninstallPluginAsync(string plugin, CancellationToken cancellationToken = default)

Parameters

plugin string

Identifier of the plugin

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

UninstallSystemPackage(string)

Uninstall a system package

public void UninstallSystemPackage(string package)

Parameters

package string

Identifier of the package

Exceptions

SocketException

Command could not be processed

See Also

UninstallSystemPackageAsync(string, CancellationToken)

Uninstall a system package asynchronously

public Task UninstallSystemPackageAsync(string package, CancellationToken cancellationToken = default)

Parameters

package string

Identifier of the package

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

WriteMessage(Message, bool, EventLogLevel)

Write an arbitrary generic message

public void WriteMessage(Message message, bool outputMessage = true, EventLogLevel logLevel = EventLogLevel.Off)

Parameters

message Message

Message

outputMessage bool

Whether to output the message

logLevel EventLogLevel

Target log level

Exceptions

SocketException

Command could not be processed

See Also

WriteMessage(MessageType, string, bool, EventLogLevel?)

Write an arbitrary generic message

public void WriteMessage(MessageType type, string message, bool outputMessage = true, EventLogLevel? logLevel = null)

Parameters

type MessageType

Message type

message string

Message content

outputMessage bool

Whether to output the message

logLevel EventLogLevel?

Target log level or null to determine log level from the message type

Exceptions

SocketException

Command could not be processed

See Also

WriteMessageAsync(Message, bool, EventLogLevel, CancellationToken)

Write an arbitrary generic message

public Task WriteMessageAsync(Message message, bool outputMessage = true, EventLogLevel logLevel = EventLogLevel.Off, CancellationToken cancellationToken = default)

Parameters

message Message

Message

outputMessage bool

Whether to output the message

logLevel EventLogLevel

Target log level

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

WriteMessageAsync(MessageType, string, bool, EventLogLevel?, CancellationToken)

Write an arbitrary generic message asynchronously

public Task WriteMessageAsync(MessageType type, string message, bool outputMessage = true, EventLogLevel? logLevel = null, CancellationToken cancellationToken = default)

Parameters

type MessageType

Message type

message string

Message content

outputMessage bool

Whether to output the message

logLevel EventLogLevel?

Target log level or null to determine log level from the message type

cancellationToken CancellationToken

Optional cancellation token

Returns

Task

Asynchronous task

Exceptions

OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

See Also

See Also