Class HardwareService
java.lang.Object
com.kosdev.kos.core.service.hardware.HardwareService
Service that manages all external hardware.
- Since:
- 1
- Version:
- 1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturn the resolver that can map a particular board identifier, such as a serial number, to a particular logical board.Return the list of resolvers so that new resolvers can be added in the desired order.voidregister(HardwareLink link) Register a hardware link.voidremoveStickyLink(String boardPath) Remove the sticky link for an optional + sticky board.voidTrigger the board resolve process.voidunregister(HardwareLink link) Unregister a hardware link.
-
Field Details
-
TOPIC_BOARD_LINKED
- See Also:
-
TOPIC_BOARD_UNLINKED
- See Also:
-
-
Method Details
-
getResolvers
Return the list of resolvers so that new resolvers can be added in the desired order. Resolvers are used to matchHardwareLinkobjects toBoardobjects. Out of the box these are matched usingBoardIdentitybut 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
Register a hardware link. The link will be matched with a board so that the board can access the hardware.- Since:
- 1
-
unregister
Unregister a hardware link. Called when hardware disconnects so the board can be updated to indicate that it is offline.- Since:
- 1
-
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
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 aBoardNotLinkedTroubleif 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 aBoardNotLinkedTrouble.- Parameters:
boardPath- path of the board to remove
-
getListeners
-