Package org.opentcs.drivers.peripherals
Interface PeripheralController
- All Superinterfaces:
Lifecycle
public interface PeripheralController extends Lifecycle
Provides high-level methods for the system to control a peripheral device.
-
Method Summary
Modifier and Type Method Description ExplainedBoolean
canProcess(PeripheralJob job)
Checks if the peripheral device would be able to process the given job, taking into account its current state.void
process(PeripheralJob job, PeripheralJobCallback callback)
Lets the peripheral device associated with this controller process the given job.void
sendCommAdapterCommand(PeripheralAdapterCommand command)
Sends aPeripheralAdapterCommand
to the communication adapter.Methods inherited from interface org.opentcs.components.Lifecycle
initialize, isInitialized, terminate
-
Method Details
-
process
void process(@Nonnull PeripheralJob job, @Nonnull PeripheralJobCallback callback) throws java.lang.IllegalStateExceptionLets the peripheral device associated with this controller process the given job. The callback is used to inform about the successful or failed completion of the job.- Parameters:
job
- The job to process.callback
- The callback to use.- Throws:
java.lang.IllegalStateException
- If this peripheral device associated with this controller cannot process the job.
-
canProcess
Checks if the peripheral device would be able to process the given job, taking into account its current state.- Parameters:
job
- A job that might have to be processed.- Returns:
- An
ExplainedBoolean
telling if the peripheral device would be able to process the job.
-
sendCommAdapterCommand
Sends aPeripheralAdapterCommand
to the communication adapter.- Parameters:
command
- The adapter command to be sent.
-