Class SerialService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.core.service.udev.serial.SerialService
- All Implemented Interfaces:
CtxEventListener
,ContextHandleAware
,HandleAware
,Ready
,ReadyListener
Service that manages serial devices.
- Since:
- 1.0
- Version:
- 2023-09-18
-
Method Summary
Modifier and TypeMethodDescriptionvoid
claimDevice
(SerialDevice device) AskSerialService
to claim ownership of the device.void
Restart the matching process for all pending devices.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReady, onBeanReady, onDependenciesReady
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Method Details
-
restartMatching
public void restartMatching()Restart the matching process for all pending devices. -
claimDevice
AskSerialService
to claim ownership of the device. This is useful when dealing with multi-port serial devices that are part of the same usb device. ASerialAdapterFactory
can find the first port, call this method to claim it, keep a reference to it, and then when the other port appears, return an adapter. This will result in both devices being owned bySerialService
.
-