Class BaseCommandConnection
Base connection class for sending commands to the control server
Inheritance
Implements
Inherited Members
Namespace: DuetAPIClient
Assembly: DuetAPIClient.dll
Syntax
public abstract class BaseCommandConnection : BaseConnection, IDisposable
Constructors
BaseCommandConnection(ConnectionMode)
Protected constructor for derived modes that can issue regular commands
Declaration
protected BaseCommandConnection(ConnectionMode mode)
Parameters
Type | Name | Description |
---|---|---|
ConnectionMode | mode | Connection type |
Methods
AddHttpEndpoint(HttpEndpointType, String, String, Boolean, Int32, CancellationToken)
Add a new third-party HTTP endpoint in the format /machine/{ns}/{path}
Declaration
public async Task<HttpEndpointUnixSocket> AddHttpEndpoint(HttpEndpointType endpointType, string ns, string path, bool isUploadRequest = false, int backlog = 4, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
HttpEndpointType | endpointType | HTTP request type |
System.String | ns | Namespace of the plugin |
System.String | path | Endpoint path |
System.Boolean | isUploadRequest | Whether this is an upload request |
System.Int32 | backlog | Number of simultaneously pending connections |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<HttpEndpointUnixSocket> | Wrapper around the UNIX socket for accepting HTTP endpoint requests |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Endpoint namespace is reserved |
System.InvalidOperationException | Endpoint is already in use |
System.IO.IOException | UNIX socket could not be opened |
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
AddUserSession(AccessLevel, SessionType, String, CancellationToken)
Add a new user session
Declaration
public Task<int> AddUserSession(AccessLevel access, SessionType type, string origin = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
AccessLevel | access | Access level of this session |
SessionType | type | Type of this session |
System.String | origin | Origin of the user session (e.g. IP address or PID) |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> | New session ID |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
CheckPassword(String, CancellationToken)
Check the given password (see M551)
Declaration
public Task<bool> CheckPassword(string password, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | password | Password to check |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if the requested password is correct |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Requested code channel is disabled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
EvaluateExpression<T>(String, CodeChannel, CancellationToken)
Evaluate an arbitrary expression
Declaration
public Task<T> EvaluateExpression<T>(string expression, CodeChannel channel = CodeChannel.SBC, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | Expression to evaluate |
CodeChannel | channel | Context of the evaluation |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | Evaluation result |
Type Parameters
Name | Description |
---|---|
T | Type of the evaluation result |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Requested code channel is disabled |
System.Text.Json.JsonException | Expected and returned data type do not match |
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
Flush(CodeChannel, CancellationToken)
Wait for all pending codes of the given channel to finish
Declaration
public Task<bool> Flush(CodeChannel channel, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CodeChannel | channel | Code channel to wait for |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if all pending codes could be flushed |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Requested code channel is disabled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
GetFileInfo(String, Boolean, CancellationToken)
Parse a G-code file and returns file information about it
Declaration
public Task<GCodeFileInfo> GetFileInfo(string fileName, bool readThumbnailContent, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file to parse |
System.Boolean | readThumbnailContent | Whether thumbnail content shall be returned |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GCodeFileInfo> | Information about the parsed file |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
GetFileInfo(String, CancellationToken)
Parse a G-code file and returns file information about it
Declaration
public Task<GCodeFileInfo> GetFileInfo(string fileName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file to parse |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GCodeFileInfo> | Information about the parsed file |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
GetMachineModel(CancellationToken)
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
Declaration
[Obsolete("Deprecated in favor of GetObjectModel")]
public Task<ObjectModel> GetMachineModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ObjectModel> | The current machine model |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
GetObjectModel(CancellationToken)
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
Declaration
public Task<ObjectModel> GetObjectModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ObjectModel> | The current machine model |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
GetSerializedMachineModel(CancellationToken)
Optimized method to directly query the machine model UTF-8 JSON
Declaration
[Obsolete("Deprecated in favor of GetSerializedObjectModel")]
public async ValueTask<MemoryStream> GetSerializedMachineModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.IO.MemoryStream> | Machine model JSON |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
GetSerializedObjectModel(CancellationToken)
Optimized method to directly query the machine model UTF-8 JSON
Declaration
public async Task<string> GetSerializedObjectModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Machine model JSON |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
InstallPlugin(String, CancellationToken)
Install or upgrade a plugin
Declaration
public Task InstallPlugin(string packageFile, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | packageFile | Absolute file path to the plugin ZIP bundle |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
InstallSystemPackage(String, CancellationToken)
Install or upgrade a system package
Declaration
public Task InstallSystemPackage(string packageFile, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | packageFile | Absolute file path to the package file |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
InvalidateChannel(CodeChannel, CancellationToken)
Invalidate all pending codes and files on the given channel
Declaration
public Task InvalidateChannel(CodeChannel channel, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CodeChannel | channel | Code channel where everything is supposed to be invalidated |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Remarks
This does NOT cancel the current code being executed by RRF!
Exceptions
Type | Condition |
---|---|
System.Net.Sockets.SocketException | Command could not be processed |
See Also
LockMachineModel(CancellationToken)
Lock the machine model for read/write access. It is MANDATORY to call UnlockMachineModel(CancellationToken) when write access has finished
Declaration
[Obsolete("Deprecated in favor of LockObjectModel")]
public Task LockMachineModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
LockObjectModel(CancellationToken)
Lock the machine model for read/write access.
Declaration
public async Task<IAsyncDisposable> LockObjectModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.IAsyncDisposable> | Asynchronous object model lock |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
PatchMachineModel(String, Object, CancellationToken)
Apply a full patch to the object model. Use with care!
Declaration
[Obsolete("Deprecated in favor of PatchObjectModel")]
public async Task PatchMachineModel(string key, object patch, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to update |
System.Object | patch | Patch to apply |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
PatchObjectModel(String, Object, CancellationToken)
Apply a full patch to the object model. Use with care!
Declaration
public async Task PatchObjectModel(string key, object patch, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to update |
System.Object | patch | Patch to apply |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
PerformCode(Code, CancellationToken)
Execute an arbitrary pre-parsed code
Declaration
public Task<Message> PerformCode(Code code, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Code | code | The code to execute |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Message> | Result of the given code |
Remarks
Cancelling the read operation does not cancel the code execution
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Requested code channel is disabled |
System.OperationCanceledException | Code or operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
PerformSimpleCode(String, CodeChannel, Boolean, CancellationToken)
Execute an arbitrary G/M/T-code in text form and return the result as a string
Declaration
public Task<string> PerformSimpleCode(string code, CodeChannel channel, bool executeAsynchronously, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The code to execute |
CodeChannel | channel | Optional destination channel of this code |
System.Boolean | executeAsynchronously | Execute this code asynchronously in the background |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Result of the given code converted to a string |
Remarks
Cancelling the read operation does not cancel the code execution
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Requested code channel is disabled |
System.OperationCanceledException | Code or operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
PerformSimpleCode(String, CodeChannel, CancellationToken)
Execute an arbitrary G/M/T-code in text form and return the result as a string
Declaration
public Task<string> PerformSimpleCode(string code, CodeChannel channel = CodeChannel.SBC, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The code to execute |
CodeChannel | channel | Optional destination channel of this code |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Result of the given code converted to a string |
Remarks
Cancelling the read operation does not cancel the code execution
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Requested code channel is disabled |
System.OperationCanceledException | Code or operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
ReloadPlugin(String, CancellationToken)
Reload a plugin manifest
Declaration
public Task ReloadPlugin(string plugin, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | plugin | Identifier of the plugin |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
RemoveHttpEndpoint(HttpEndpointType, String, String, CancellationToken)
Remove an existing HTTP endpoint
Declaration
public Task<bool> RemoveHttpEndpoint(HttpEndpointType endpointType, string ns, string path, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
HttpEndpointType | endpointType | Type of the endpoint to remove |
System.String | ns | Namespace of the endpoint to remove |
System.String | path | Endpoint to remove |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if the endpoint could be removed |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
RemoveUserSession(Int32, CancellationToken)
Remove an existing user session
Declaration
public Task<bool> RemoveUserSession(int id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | Identifier of the session |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if the session could be removed |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
ResolvePath(String, CancellationToken)
Resolve a RepRapFirmware-style file path to a real file path
Declaration
public Task<string> ResolvePath(string path, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | path | File path to resolve |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Resolved file path |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
SetMachineModel(String, String, CancellationToken)
Set a given property to a certain value. Make sure to lock the object model before calling this
Declaration
[Obsolete("Deprecated in favor of SetObjectModel")]
public Task<bool> SetMachineModel(string path, string value, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to the property |
System.String | value | New value as string |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if the property could be updated |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
SetObjectModel(String, String, CancellationToken)
Set a given property to a certain value. Make sure to lock the object model before calling this
Declaration
public Task<bool> SetObjectModel(string path, string value, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path to the property |
System.String | value | New value as string |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if the property could be updated |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
SetPluginData(String, Object, String, CancellationToken)
Set custom plugin data in the object model
Declaration
public Task SetPluginData(string key, object value, string plugin = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to set |
System.Object | value | Value to set |
System.String | plugin | Identifier of the plugin to update (optional) |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
System.UnauthorizedAccessException | Insufficient permissions to modify other plugin data |
See Also
SetUpdateStatus(Boolean, CancellationToken)
Override the current machine status if a software update is in progress
Declaration
public Task SetUpdateStatus(bool isUpdating, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isUpdating | If the machine status is supposed to be overrridden |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Remarks
The object model must not be locked when this is called
StartPlugin(String, CancellationToken)
Start a plugin
Declaration
public Task StartPlugin(string plugin, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | plugin | Identifier of the plugin |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
StopPlugin(String, CancellationToken)
Stop a plugin
Declaration
public Task StopPlugin(string plugin, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | plugin | Identifier of the plugin |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
SyncMachineModel(CancellationToken)
Wait for the full machine model to be updated from RepRapFirmware
Declaration
[Obsolete("Deprecated in favor of SyncObjectModel")]
public Task SyncMachineModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
SyncObjectModel(CancellationToken)
Wait for the full object model to be updated from RepRapFirmware
Declaration
public Task SyncObjectModel(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
UninstallPlugin(String, CancellationToken)
Uninstall a plugin
Declaration
public Task UninstallPlugin(string plugin, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | plugin | Identifier of the plugin |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
UninstallSystemPackage(String, CancellationToken)
Uninstall a system package
Declaration
public Task UninstallSystemPackage(string package, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | package | Identifier of the package |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
UnlockMachineModel(CancellationToken)
Unlock the machine model again
Declaration
[Obsolete("Deprecated in favor of UnlockObjectModel")]
public Task UnlockMachineModel(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
WriteMessage(Message, Boolean, LogLevel, CancellationToken)
Write an arbitrary generic message
Declaration
public Task WriteMessage(Message message, bool outputMessage = true, LogLevel logLevel = LogLevel.Off, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Message | message | Message |
System.Boolean | outputMessage | Whether to output the message |
LogLevel | logLevel | Target log level |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
WriteMessage(Message, Boolean, Boolean, CancellationToken)
Write an arbitrary generic message
Declaration
[Obsolete("This overload is deprecated because it lacks support for log levels")]
public Task WriteMessage(Message message, bool outputMessage = true, bool logMessage = false, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Message | message | Message |
System.Boolean | outputMessage | Whether to output the message |
System.Boolean | logMessage | Whether to log the message |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
WriteMessage(MessageType, String, Boolean, Boolean, CancellationToken)
Write an arbitrary generic message
Declaration
[Obsolete("This overload is deprecated because it lacks support for log levels")]
public Task WriteMessage(MessageType type, string message, bool outputMessage, bool logMessage, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MessageType | type | Message type |
System.String | message | Message content |
System.Boolean | outputMessage | Whether to output the message |
System.Boolean | logMessage | Whether to log the message |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |
See Also
WriteMessage(MessageType, String, Boolean, Nullable<LogLevel>, CancellationToken)
Write an arbitrary generic message
Declaration
public Task WriteMessage(MessageType type, string message, bool outputMessage = true, LogLevel? logLevel = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MessageType | type | Message type |
System.String | message | Message content |
System.Boolean | outputMessage | Whether to output the message |
System.Nullable<LogLevel> | logLevel | Target log level or null to determine log level from the message type |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Asynchronous task |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Operation has been cancelled |
System.Net.Sockets.SocketException | Command could not be processed |