Schnittstelle PeripheralCommAdapter

Alle Superschnittstellen:
Lifecycle
Alle bekannten Implementierungsklassen:
BasicPeripheralCommAdapter

public interface PeripheralCommAdapter extends Lifecycle
This interface declares the methods that a driver communicating with and controlling a peripheral device must implement.
  • Methodendetails

    • enable

      void enable()
      Enables this comm adapter, i.e. turns it on.
    • disable

      void disable()
      Disables this comm adapter, i.e. turns it off.
    • isEnabled

      boolean isEnabled()
      Checks whether this communication adapter is enabled.
      Gibt zurück:
      true if, and only if, this communication adapter is enabled.
    • getProcessModel

      @Nonnull PeripheralProcessModel getProcessModel()
      Returns a model of the peripheral device's and its communication adapter's attributes.
      Gibt zurück:
      A model of the peripheral device's and its communication adapter's attributes.
    • canProcess

      @Nonnull ExplainedBoolean canProcess(@Nonnull PeripheralJob job)
      Checks if the peripheral device would be able to process the given job, taking into account its current state.
      Parameter:
      job - A job that might have to be processed.
      Gibt zurück:
      An ExplainedBoolean telling if the peripheral device would be able to process the job.
    • process

      void process(@Nonnull PeripheralJob job, @Nonnull PeripheralJobCallback callback)
      Processes the given job by sending it or a representation that the peripheral device understands to the peripheral device itself.
      Parameter:
      job - The job to process.
      callback - The callback to use to report back about the successful or failed completion of the job.
    • abortJob

      void abortJob()
      Aborts the current job, if any.

      Whether a job can actually be aborted depends on the actual peripheral/job semantics. The callback for the current job may still be called to indicate the job has failed, but it is not strictly expected to. The kernel will ignore calls to the callback after calling this method.

    • execute

      void execute(@Nonnull PeripheralAdapterCommand command)
      Executes the given PeripheralAdapterCommand.
      Parameter:
      command - The command to execute.