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
modeConnectionModeConnection 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
endpointTypeHttpEndpointTypeHTTP request type
nsstringNamespace of the plugin
pathstringEndpoint path
isUploadRequestboolWhether this is an upload request
backlogintNumber 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
endpointTypeHttpEndpointTypeHTTP request type
nsstringNamespace of the plugin
pathstringEndpoint path
isUploadRequestboolWhether this is an upload request
backlogintNumber of simultaneously pending connections
cancellationTokenCancellationTokenOptional 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
accessAccessLevelAccess level of this session
typeSessionTypeType of this session
originstringOrigin 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
accessAccessLevelAccess level of this session
typeSessionTypeType of this session
originstringOrigin of the user session (e.g. IP address or PID)
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
passwordstringPassword 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
passwordstringPassword to check
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
expressionstringExpression to evaluate
channelCodeChannelContext 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
expressionstringExpression to evaluate
channelCodeChannelContext of the evaluation
cancellationTokenCancellationTokenOptional 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
channelCodeChannelCode 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
channelCodeChannelCode channel to wait for
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
fileNamestringThe 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
fileNamestringThe file to parse
readThumbnailContentboolWhether 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
fileNamestringThe file to parse
readThumbnailContentboolWhether thumbnail content shall be returned
cancellationTokenCancellationTokenOptional 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
fileNamestringThe file to parse
cancellationTokenCancellationTokenOptional 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
cancellationTokenCancellationTokenOptional 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
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
packageFilestringAbsolute 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
packageFilestringAbsolute file path to the plugin ZIP bundle
cancellationTokenCancellationTokenOptional 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
packageFilestringAbsolute 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
packageFilestringAbsolute file path to the package file
cancellationTokenCancellationTokenOptional 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
channelCodeChannelCode 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
channelCodeChannelCode channel where everything is supposed to be invalidated
cancellationTokenCancellationTokenOptional 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
cancellationTokenCancellationTokenOptional 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
pluginstringPlugin 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
pluginstringPlugin ID (only needed if running as root)
cancellationTokenCancellationTokenOptional 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
keystringKey to update
patchJsonElementPatch 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
keystringKey to update
patchJsonElementPatch to apply
cancellationTokenCancellationTokenOptional 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
codeCodeThe 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
codeCodeThe code to execute
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
codestringThe code to execute
channelCodeChannelOptional 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
codestringThe code to execute
channelCodeChannelOptional destination channel of this code
executeAsynchronouslyboolExecute 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
codestringThe code to execute
channelCodeChannelOptional destination channel of this code
executeAsynchronouslyboolExecute this code asynchronously in the background
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
codestringThe code to execute
channelCodeChannelOptional destination channel of this code
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
keystringObject model key path (e.g. "heat", "move.axes")
flagsstringRRF-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
keystringObject model key path (e.g. "heat", "move.axes")
flagsstringRRF-compatible flags string (e.g. "f", "fn", "d99vn")
cancellationTokenCancellationTokenOptional 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
pluginstringIdentifier 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
pluginstringIdentifier of the plugin
cancellationTokenCancellationTokenOptional 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
endpointTypeHttpEndpointTypeType of the endpoint to remove
nsstringNamespace of the endpoint to remove
pathstringEndpoint 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
endpointTypeHttpEndpointTypeType of the endpoint to remove
nsstringNamespace of the endpoint to remove
pathstringEndpoint to remove
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
idintIdentifier 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
idintIdentifier of the session
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
pathstringFile 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
pathstringFile path to resolve
baseDirectoryFileDirectoryBase 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
pathstringFile path to resolve
baseDirectoryFileDirectoryBase directory to resolve the path relative to
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
pathstringFile path to resolve
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
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
pathstringPath to the property
valuestringNew value as string
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
keystringKey to set
valueJsonElementValue to set
pluginstringIdentifier 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
keystringKey to set
valueJsonElementValue to set
pluginstringIdentifier of the plugin to update (optional)
cancellationTokenCancellationTokenOptional 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
isUpdatingboolIf 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
isUpdatingboolIf the machine status is supposed to be overrridden
cancellationTokenCancellationTokenOptional 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
pluginstringIdentifier 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
pluginstringIdentifier of the plugin
cancellationTokenCancellationTokenOptional 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
pluginstringIdentifier 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
pluginstringIdentifier of the plugin
cancellationTokenCancellationTokenOptional 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
cancellationTokenCancellationTokenOptional 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
pluginstringIdentifier 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
pluginstringIdentifier of the plugin
cancellationTokenCancellationTokenOptional 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
packagestringIdentifier 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
packagestringIdentifier of the package
cancellationTokenCancellationTokenOptional 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
messageMessageMessage
outputMessageboolWhether to output the message
logLevelEventLogLevelTarget 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
typeMessageTypeMessage type
messagestringMessage content
outputMessageboolWhether to output the message
logLevelEventLogLevel?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
messageMessageMessage
outputMessageboolWhether to output the message
logLevelEventLogLevelTarget log level
cancellationTokenCancellationTokenOptional 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
typeMessageTypeMessage type
messagestringMessage content
outputMessageboolWhether to output the message
logLevelEventLogLevel?Target log level or null to determine log level from the message type
cancellationTokenCancellationTokenOptional cancellation token
Returns
- Task
Asynchronous task
Exceptions
- OperationCanceledException
Operation has been cancelled
- SocketException
Command could not be processed
- See Also