Class SerialAdapterFactory
- Since:
- 1.0
- Version:
- 2023-09-19
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AdaptermatchDevice(SerialDevice device) Called with aSerialDeviceto see if it matches this factory.
-
Constructor Details
-
SerialAdapterFactory
public SerialAdapterFactory()
-
-
Method Details
-
matchDevice
Called with aSerialDeviceto see if it matches this factory. If so, return aSerialAdapterinstance for the device. This will claim the device and start the adapter.This may be called multiple times for the same device if no factory claims it. The callback interval and max retry time are both config options in
SerialService.In some cases, hardware needs to be probed to identify what it actually is (when the same usb serial hardware is used on multiple boards). The
SerialDevicesupports opening the serial device for the purpose of probing the hardware. This should only be used for probing and care should be taken to close the device if opened.Some devices can take time to boot once connected. Use
device.getRunTimeMs()to determine how long the device has been connected. For devices that need boot time allowances, this method can return null until the required boot time has passed and then probe the hardware.- Returns:
SerialAdapterfor the device or null
-