Skip to content
This repository was archived by the owner on Aug 25, 2020. It is now read-only.
This repository was archived by the owner on Aug 25, 2020. It is now read-only.

Exception when detaching device if drivers are connected to it #101

@danbim

Description

@danbim

If you detach a device from the USB port the driver will throw an exception like this:

2011-12-27 17:13:36,860 | [urn:local:0xb2a6]-Thread 2    | InputStreamCopyRunnable        | ERROR | IOException while reading from device InputStream: java.io.IOException: Device not configured in nativeavailable
java.io.IOException: Device not configured in nativeavailable
    at gnu.io.RXTXPort.nativeavailable(Native Method)
    at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532)
    at de.uniluebeck.itm.wsn.drivers.core.concurrent.InputStreamCopyRunnable.copyAvailableBytes(InputStreamCopyRunnable.java:81)
    at de.uniluebeck.itm.wsn.drivers.core.concurrent.InputStreamCopyRunnable.run(InputStreamCopyRunnable.java:62)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

It would be nice if that exception would be handled in some clean way, e.g. by throwing a typed exception or producing some event indicating that the device has been detached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions