Class LinkService
- Namespace
- DuetControlServer.Link
- Assembly
- DuetControlServer.dll
This class accesses RepRapFirmware via SPI and deals with general communication
public sealed class LinkService : BackgroundService, IHostedService, IDisposable
- Inheritance
-
LinkService
- Implements
- Inherited Members
Constructors
LinkService(Manager, EventLogger, FilePathResolver, JobProcessor, ILinkAdapter, LinkInterface, ObjectModel, IHostApplicationLifetime, ILogger<LinkService>, IOptions<Settings>)
This class accesses RepRapFirmware via SPI and deals with general communication
public LinkService(Manager channels, EventLogger eventLogger, FilePathResolver filePathResolver, JobProcessor jobProcessor, ILinkAdapter linkAdapter, LinkInterface linkInterface, ObjectModel model, IHostApplicationLifetime lifetime, ILogger<LinkService> logger, IOptions<Settings> settings)
Parameters
channelsManagerChannel manager
eventLoggerEventLoggerEvent logger
filePathResolverFilePathResolverFile path resolver
jobProcessorJobProcessorJob processor
linkAdapterILinkAdapterFirmware link adapter
linkInterfaceLinkInterfaceLink interface
modelObjectModelObject model
lifetimeIHostApplicationLifetimeHost application lifetime
loggerILogger<LinkService>Logger
settingsIOptions<Settings>Settings
Fields
_openFileHandleCounter
Handle counter for open files
public uint _openFileHandleCounter
Field Value
Methods
ExecuteAsync(CancellationToken)
Start a thread that performs the communication with the firmware
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationTokenCancellation token
Returns
Remarks
This effectively starts a thread with higher priority in order to ensure that the communication with the controller is not blocked by other tasks
StartAsync(CancellationToken)
Start this service asynchronously
public override Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token
Returns
- Task
Asynchronous task
StopAsync(CancellationToken)
Shut down this service
public override Task StopAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationTokenCancellation token
Returns
- Task
Asynchronous task