1 package org.minetti.astrodevice.server.plugin.driver;
2
3 import org.minetti.astrodevice.server.plugin.AstroDevicePluginException;
4 import org.minetti.astrodevice.server.plugin.Plugin;
5
6 /**
7 * Driver for any device.
8 * @author Jean-Philippe MINETTI
9 */
10 public interface DeviceDriver {
11
12 /**
13 * Returns the plug-in of driver.
14 * @return Plug-in of driver.
15 */
16 Plugin getPlugin();
17
18 /**
19 * Opens a new connection to the USB device and returns all informations on this device.
20 * @throws AstroDevicePluginException Exception if an error occurred.
21 */
22 void open() throws AstroDevicePluginException;
23
24 /**
25 * Closes the connection of USB device.
26 * @throws AstroDevicePluginException Exception if an error occurred.
27 */
28 void close() throws AstroDevicePluginException;
29
30 /**
31 * Returns <code>TRUE</code> if the USB device is connected.
32 * @return <code>TRUE</code> if the USB device is connected.
33 */
34 boolean isOpened();
35
36 }