diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-27 14:40:42 +0200 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-27 14:40:42 +0200 |
| commit | 5d8eafe9e8c36c86f9b4c33f32305866dd898f3e (patch) | |
| tree | 495158ddee0c0eb2ce33111e37ae2a449c24305d /src/device/Driver.java | |
| parent | 25b636c0afd61245765b521dd03255f0ecd4ef8f (diff) | |
Add state class
Diffstat (limited to 'src/device/Driver.java')
| -rw-r--r-- | src/device/Driver.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/device/Driver.java b/src/device/Driver.java index d629aa7..a099d95 100644 --- a/src/device/Driver.java +++ b/src/device/Driver.java @@ -110,12 +110,15 @@ public class Driver{ // Init HIDAPI Library com.codeminders.hidapi.ClassPathLibraryLoader.loadNativeHIDLibrary(); + // Try not bind the device try { HIDManager man=HIDManager.getInstance(); this.device=man.openById(0x1770, 0xff00, null); + if(this.device==null) + throw new Exception(); } catch(Exception e){ - throw new InstantiationException("Failed to instanciate driver."); + throw new InstantiationException("Failed to instanciate driver. Device not found or permission denied (try as root)"); } } |
