Class HardwareService

java.lang.Object
com.kosdev.kos.core.service.hardware.HardwareService

public final class HardwareService extends Object
Service that manages all external hardware.
Since:
1
Version:
1
  • Field Details

  • Method Details

    • getResolvers

      public List<HardwareLinkResolver> getResolvers()
      Return the list of resolvers so that new resolvers can be added in the desired order. Resolvers are used to match HardwareLink objects to Board objects. Out of the box these are matched using BoardIdentity but the list of resolvers can be modified to include alternate ways of matching boards to links.
      Since:
      1
    • resolveBoards

      public void resolveBoards()
      Trigger the board resolve process. This process is triggered internally so there is rarely a need to call this externally unless the resolvers list has been modified.
      Since:
      1
    • register

      public void register(HardwareLink link)
      Register a hardware link. The link will be matched with a board so that the board can access the hardware.
      Since:
      1
    • unregister

      public void unregister(HardwareLink link)
      Unregister a hardware link. Called when hardware disconnects so the board can be updated to indicate that it is offline.
      Since:
      1
    • getIdentityMappingResolver

      public IdentityMappingResolver getIdentityMappingResolver()
      Return the resolver that can map a particular board identifier, such as a serial number, to a particular logical board. This can be used to access the board mappings managed by this resolver.
      Since:
      1
    • removeStickyLink

      public void removeStickyLink(String boardPath)
      Remove the sticky link for an optional + sticky board. Once an optional and sticky board links, the link identity is persisted and from that point forward the board is expected to exist, and will generate a BoardNotLinkedTrouble if missing. In the event that the board is removed intentionally (the optional components were uninstalled), this call will remove the persistent record of the link so that the board will no longer generate a BoardNotLinkedTrouble .
      Parameters:
      boardPath - path of the board to remove
    • getListeners

      public ListenerList<HardwareListener> getListeners()