Interface PeripheralCommAdapter

All Superinterfaces:
Lifecycle
All Known Implementing Classes:
BasicPeripheralCommAdapter

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

    • 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.
      Returns:
      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.
      Returns:
      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.
      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.
    • 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. 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.
    • execute

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