• DuetAPI
  • DuetAPIClient
  • DuetControlServer
  • DuetWebServer
Show / Hide Table of Contents
  • DuetAPI
    • CodeChannel
    • CodeParserException
    • IncompatibleVersionException
    • InternalServerException
    • InvalidParameterTypeException
    • MissingParameterException
  • DuetAPI.Commands
    • Acknowledge
    • AddHttpEndpoint
    • AddUserSession
    • BaseCommand
    • BaseResponse
    • Cancel
    • CheckPassword
    • Code
    • CodeFlags
    • CodeParameter
    • CodeParameterConverter
    • CodeParserBuffer
    • CodeType
    • Command
    • Command<T>
    • ErrorResponse
    • EvaluateExpression
    • Flush
    • GetFileInfo
    • GetObjectModel
    • HttpResponseType
    • Ignore
    • InstallPlugin
    • InstallSystemPackage
    • InvalidateChannel
    • KeywordType
    • LockObjectModel
    • PatchObjectModel
    • ReceivedHttpRequest
    • ReloadPlugin
    • RemoveHttpEndpoint
    • RemoveUserSession
    • Resolve
    • ResolvePath
    • Response<T>
    • SendHttpResponse
    • SetNetworkProtocol
    • SetObjectModel
    • SetPluginData
    • SetPluginProcess
    • SetUpdateStatus
    • SimpleCode
    • StartPlugin
    • StartPlugins
    • StopPlugin
    • StopPlugins
    • SyncObjectModel
    • UninstallPlugin
    • UninstallSystemPackage
    • UnlockObjectModel
    • WriteMessage
  • DuetAPI.Connection
    • ConnectionMode
    • Defaults
    • InterceptionMode
    • SubscriptionMode
  • DuetAPI.Connection.InitMessages
    • ClientInitMessage
    • CodeStreamInitMessage
    • CommandInitMessage
    • InterceptInitMessage
    • PluginServiceInitMessage
    • ServerInitMessage
    • SubscribeInitMessage
  • DuetAPI.ObjectModel
    • Accelerometer
    • AccessLevel
    • AnalogSensor
    • AnalogSensorType
    • AnalogSensorTypeConverter
    • Axis
    • BeepRequest
    • Board
    • BoardClosedLoop
    • BoardState
    • Build
    • BuildObject
    • CPU
    • ClosedLoopCurrentFraction
    • ClosedLoopPositionError
    • Compatibility
    • CoreKinematics
    • CurrentMove
    • DSF
    • DeltaKinematics
    • DeltaTower
    • DeserializationFailedEventArgs
    • DeserializationFailedEventHandler
    • DirectDisplay
    • DirectDisplayController
    • DirectDisplayEncoder
    • DirectDisplayScreen
    • DirectDisplayScreenST7567
    • Directories
    • DistanceUnit
    • DistanceUnitConverter
    • Driver
    • DriverClosedLoop
    • Duet3DFilamentMonitor
    • Endstop
    • EndstopType
    • Extruder
    • ExtruderNonlinear
    • Fan
    • FanThermostaticControl
    • FilamentMonitor
    • FilamentMonitorEnableMode
    • FilamentMonitorStatus
    • FilamentMonitorType
    • GCodeFileInfo
    • GCodeFileInfoConverter
    • GpInputPort
    • GpOutputPort
    • HangprinterKinematics
    • Heat
    • Heater
    • HeaterModel
    • HeaterModelPID
    • HeaterMonitor
    • HeaterMonitorAction
    • HeaterMonitorCondition
    • HeaterState
    • HttpEndpoint
    • HttpEndpointType
    • IGrowingModelCollection
    • IModelCollection
    • IModelDictionary
    • IModelObject
    • InductiveSensor
    • InputChannel
    • InputChannelState
    • InputShaping
    • InputShapingType
    • Inputs
    • Job
    • KeepoutZone
    • KeepoutZoneCoordinates
    • Kinematics
    • KinematicsName
    • KinematicsNameConverter
    • LaserFilamentMonitor
    • LaserFilamentMonitorCalibrated
    • LaserFilamentMonitorConfigured
    • Layer
    • LedStrip
    • LedStripType
    • LimitedResponseCountAttribute
    • Limits
    • LogLevel
    • MachineMode
    • MachineStatus
    • Memory
    • Message
    • MessageBox
    • MessageBoxMode
    • MessageType
    • Microstepping
    • MinMaxCurrent<T>
    • ModelCollection<T>
    • ModelDictionaryConverter
    • ModelDictionary<TValue>
    • ModelGrowingCollection<T>
    • ModelObject
    • MotorsIdleControl
    • Move
    • MoveCalibration
    • MoveCompensation
    • MoveCompensationType
    • MoveDeviations
    • MoveQueueItem
    • MoveRotation
    • MoveSegmentation
    • Network
    • NetworkInterface
    • NetworkInterfaceType
    • NetworkProtocol
    • NetworkState
    • ObjectModel
    • ObjectModelConverter
    • Plugin
    • PluginManifest
    • PolarKinematics
    • Probe
    • ProbeGrid
    • ProbeType
    • PulsedFilamentMonitor
    • PulsedFilamentMonitorCalibrated
    • PulsedFilamentMonitorConfigured
    • RestorePoint
    • RotatingMagnetFilamentMonitor
    • RotatingMagnetFilamentMonitorCalibrated
    • RotatingMagnetFilamentMonitorConfigured
    • SBC
    • SbcPropertyAttribute
    • ScaraKinematics
    • Sensors
    • SessionType
    • Skew
    • Spindle
    • SpindleState
    • StartupError
    • State
    • TemperatureError
    • ThumbnailInfo
    • ThumbnailInfoFormat
    • TiltCorrection
    • TimesLeft
    • Tool
    • ToolRetraction
    • ToolState
    • UserSession
    • Volume
    • ZLeadscrewKinematics
  • DuetAPI.Utility
    • DriverId
    • DriverIdJsonConverter
    • FileLists
    • Heightmap
    • JsonCamelCaseStringEnumConverter
    • JsonCharEnumConverter
    • JsonHelper
    • JsonLowerCaseStringEnumConverter
    • JsonOptionalShortDateTimeConverter
    • JsonPolymorphicWriteOnlyConverter<T>
    • JsonRegexListConverter
    • JsonShortDateTimeConverter
    • RequiredPermissionsAttribute
    • SbcPermissions
    • SbcPermissionsConverter
  • DuetAPIClient
    • BaseCommandConnection
    • BaseConnection
    • CodeStreamConnection
    • CommandConnection
    • HttpEndpointConnection
    • HttpEndpointUnixSocket
    • HttpEndpointUnixSocket.EndpointRequestReceived
    • InterceptConnection
    • SubscribeConnection
  • DuetControlServer
    • Program
    • Settings
  • DuetControlServer.Codes
    • ChannelProcessor
    • PipelineStage
    • Processor
  • DuetControlServer.Codes.Handlers
    • Functions
    • GCodes
    • Keywords
    • MCodes
    • TCodes
  • DuetControlServer.Codes.Pipelines
    • Executed
    • Firmware
    • PipelineBase
    • PipelineStackItem
    • Post
    • Pre
    • ProcessInternally
    • Start
  • DuetControlServer.Commands
    • AddHttpEndpoint
    • AddUserSession
    • CheckPassword
    • Code
    • EvaluateExpression
    • Flush
    • GetFileInfo
    • GetObjectModel
    • IConnectionCommand
    • InstallPlugin
    • InstallSystemPackage
    • InvalidateChannel
    • LockObjectModel
    • PatchObjectModel
    • ReloadPlugin
    • RemoveHttpEndpoint
    • RemoveUserSession
    • ResolvePath
    • SetNetworkProtocol
    • SetObjectModel
    • SetPluginData
    • SetPluginProcess
    • SetUpdateStatus
    • SimpleCode
    • StartPlugin
    • StartPlugins
    • StopPlugin
    • StopPlugins
    • SyncObjectModel
    • UninstallPlugin
    • UninstallSystemPackage
    • UnlockObjectModel
    • WriteMessage
  • DuetControlServer.Files
    • CodeBlock
    • CodeFile
    • FileDirectory
    • FilePath
    • InfoParser
    • JobProcessor
    • MacroFile
  • DuetControlServer.Files.ImageProcessing
    • IconImageParser
    • ImageParser
    • ImageProcessingException
  • DuetControlServer.IPC
    • Connection
    • LockManager
    • Server
  • DuetControlServer.IPC.Processors
    • Base
    • CodeInterception
    • CodeStream
    • Command
    • ModelSubscription
    • PluginService
  • DuetControlServer.Model
    • Expressions
    • Expressions.CustomAsyncFunctionResolver
    • Filter
    • ItemPathNode
    • Observer
    • Observer.PropertyPathChanged
    • PeriodicUpdater
    • PropertyChangeType
    • Provider
    • Updater
  • DuetControlServer.SPI
    • DataTransfer
    • EvaluateExpressionRequest
    • Interface
    • Interface.MovementLock
    • VariableRequest
  • DuetControlServer.SPI.Channel
    • LockRequest
    • Manager
    • Processor
    • State
  • DuetControlServer.SPI.Communication
    • Consts
  • DuetControlServer.SPI.Communication.FirmwareRequests
    • AbortFileHeader
    • CodeBufferUpdateHeader
    • DoCodeHeader
    • EvaluationResultHeader
    • ExecuteMacroHeader
    • FileChunkHeader
    • FileHandleHeader
    • OpenFileHeader
    • PrintPausedHeader
    • PrintPausedReason
    • ReadFileHeader
    • Request
    • SeekFileHeader
  • DuetControlServer.SPI.Communication.SbcRequests
    • AssignFilamentHeader
    • BooleanHeader
    • CodeFlags
    • CodeHeader
    • CodeParameter
    • DeleteLocalVariableHeader
    • FileChunkHeader
    • FileDataHeader
    • GetObjectModelHeader
    • MacroCompleteHeader
    • OpenFileResult
    • PrintStartedHeader
    • PrintStoppedHeader
    • Request
    • SetObjectModelHeader
    • SetVariableHeader
  • DuetControlServer.SPI.Communication.Shared
    • CodeChannelHeader
    • DataType
    • HeightMapHeader
    • MessageHeader
    • MessageTypeFlags
    • PacketHeader
    • PrintStoppedReason
    • StringHeader
    • TransferHeader
    • TransferResponse
  • DuetControlServer.SPI.Serialization
    • Reader
    • Writer
  • DuetControlServer.Utility
    • BuildDateTimeAttribute
    • CRC16
    • CRC32
    • Firmware
    • Logger
    • PriorityThreadRunner
  • DuetWebServer
    • Program
    • Settings
    • Startup
  • DuetWebServer.Authorization
    • Policies
    • SessionKeyAuthenticationHandler
    • SessionKeyAuthenticationSchemeOptions
  • DuetWebServer.Controllers
    • MachineController
    • RepRapFirmwareController
    • WebSocketController
  • DuetWebServer.FileProviders
    • DuetFileProvider
  • DuetWebServer.Middleware
    • CustomEndpointMiddleware
    • FallbackMiddleware
    • FixContentTypeMiddleware
    • HttpEndpointConnection
  • DuetWebServer.Services
    • ModelObserver
    • SessionExpiry
  • DuetWebServer.Singletons
    • IModelProvider
    • IModelProvider.WebDirectoryChanged
    • ISessionStorage
    • ModelProvider
    • SessionStorage
  • DuetWebServer.Utility
    • CRC32

Class CommandConnection

Connection class for sending commands to the control server

Inheritance
object
BaseConnection
BaseCommandConnection
CommandConnection
Implements
IDisposable
Inherited Members
BaseCommandConnection.AddHttpEndpoint(HttpEndpointType, string, string, bool, int, CancellationToken)
BaseCommandConnection.AddUserSession(AccessLevel, SessionType, string, CancellationToken)
BaseCommandConnection.CheckPassword(string, CancellationToken)
BaseCommandConnection.EvaluateExpression<T>(string, CodeChannel, CancellationToken)
BaseCommandConnection.Flush(CodeChannel, CancellationToken)
BaseCommandConnection.GetFileInfo(string, CancellationToken)
BaseCommandConnection.GetFileInfo(string, bool, CancellationToken)
BaseCommandConnection.GetMachineModel(CancellationToken)
BaseCommandConnection.GetObjectModel(CancellationToken)
BaseCommandConnection.GetSerializedMachineModel(CancellationToken)
BaseCommandConnection.GetSerializedObjectModel(CancellationToken)
BaseCommandConnection.InstallPlugin(string, CancellationToken)
BaseCommandConnection.InstallSystemPackage(string, CancellationToken)
BaseCommandConnection.InvalidateChannel(CodeChannel, CancellationToken)
BaseCommandConnection.LockMachineModel(CancellationToken)
BaseCommandConnection.LockObjectModel(CancellationToken)
BaseCommandConnection.PatchMachineModel(string, object, CancellationToken)
BaseCommandConnection.PatchObjectModel(string, object, CancellationToken)
BaseCommandConnection.PatchObjectModel(string, JsonElement, CancellationToken)
BaseCommandConnection.PerformCode(Code, CancellationToken)
BaseCommandConnection.PerformSimpleCode(string, CodeChannel, CancellationToken)
BaseCommandConnection.PerformSimpleCode(string, CodeChannel, bool, CancellationToken)
BaseCommandConnection.ReloadPlugin(string, CancellationToken)
BaseCommandConnection.RemoveHttpEndpoint(HttpEndpointType, string, string, CancellationToken)
BaseCommandConnection.RemoveUserSession(int, CancellationToken)
BaseCommandConnection.ResolvePath(string, CancellationToken)
BaseCommandConnection.SetMachineModel(string, string, CancellationToken)
BaseCommandConnection.SetObjectModel(string, string, CancellationToken)
BaseCommandConnection.SetPluginData(string, object, string, CancellationToken)
BaseCommandConnection.SetPluginData(string, JsonElement, string, CancellationToken)
BaseCommandConnection.SetUpdateStatus(bool, CancellationToken)
BaseCommandConnection.StartPlugin(string, CancellationToken)
BaseCommandConnection.StopPlugin(string, CancellationToken)
BaseCommandConnection.SyncMachineModel(CancellationToken)
BaseCommandConnection.SyncObjectModel(CancellationToken)
BaseCommandConnection.UninstallPlugin(string, CancellationToken)
BaseCommandConnection.UninstallSystemPackage(string, CancellationToken)
BaseCommandConnection.UnlockMachineModel(CancellationToken)
BaseCommandConnection.WriteMessage(MessageType, string, bool, bool, CancellationToken)
BaseCommandConnection.WriteMessage(MessageType, string, bool, LogLevel?, CancellationToken)
BaseCommandConnection.WriteMessage(Message, bool, bool, CancellationToken)
BaseCommandConnection.WriteMessage(Message, bool, LogLevel, CancellationToken)
BaseConnection.Dispose()
BaseConnection.Id
BaseConnection.IsConnected
BaseConnection.Close()
BaseConnection.Poll()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DuetAPIClient
Assembly: DuetAPIClient.dll
Syntax
public sealed class CommandConnection : BaseCommandConnection, IDisposable

Constructors

CommandConnection()

Create a new connection in command mode

Declaration
public CommandConnection()

Methods

Connect(string, CancellationToken)

Establish a connection to the given UNIX socket file

Declaration
public Task Connect(string socketPath = "/run/dsf/dcs.sock", CancellationToken cancellationToken = default)
Parameters
Type Name Description
string socketPath

Path to the UNIX socket file

CancellationToken cancellationToken

Optional cancellation token

Returns
Type Description
Task

Asynchronous task

Exceptions
Type Condition
IncompatibleVersionException

API level is incompatible

IOException

Connection mode is unavailable

OperationCanceledException

Operation has been cancelled

SocketException

Init message could not be processed

SetNetworkProtocol(NetworkProtocol, bool, CancellationToken)

Update the status of a network protocol. Reserved for internal purposes, do not use

Declaration
public Task SetNetworkProtocol(NetworkProtocol protocol, bool enabled, CancellationToken cancellationToken = default)
Parameters
Type Name Description
NetworkProtocol protocol

Protocol to update

bool enabled

If it is enabled or not

CancellationToken cancellationToken

Optional cancellation token

Returns
Type Description
Task

Asynchronous task

Exceptions
Type Condition
OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

SetPluginProcess(string, int, CancellationToken)

Update the process id of a given plugin. Reserved for internal purposes, do not use

Declaration
public Task SetPluginProcess(string name, int pid, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string name

Name of the plugin

int pid

New process id

CancellationToken cancellationToken

Optional cancellation token

Returns
Type Description
Task

Asynchronous task

Exceptions
Type Condition
OperationCanceledException

Operation has been cancelled

SocketException

Command could not be processed

Implements

IDisposable

See Also

Command
In this article
Back to top Generated by DocFX