/*
 * Author : Rishi Gupta
 * 
 * This file is part of 'serial communication manager' library.
 *
 * The 'serial communication manager' is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by the Free Software 
 * Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * The 'serial communication manager' is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
 * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with serial communication manager. If not, see <http://www.gnu.org/licenses/>.
 */

package test82;

import com.embeddedunveiled.serial.SerialComHID;
import com.embeddedunveiled.serial.SerialComManager;

public class Test82  {

	public static SerialComManager scm = null;
	public static String PORT = null;
	public static String PORT1 = null;

	public static void main(String[] args) {
		try {
			scm = new SerialComManager();
			String PORT = null;
			int osType = scm.getOSType();
			if(osType == SerialComManager.OS_LINUX) {
				PORT = "/dev/hiddev0";
			}else if(osType == SerialComManager.OS_WINDOWS) {
				PORT = "COM51";
			}else if(osType == SerialComManager.OS_MAC_OS_X) {
				PORT = "/dev/cu.usbserial-A70362A3";
			}else if(osType == SerialComManager.OS_SOLARIS) {
				PORT = null;
			}else{
			}
			SerialComHID sch = scm.getSerialComHIDInstance(SerialComHID.HID_GENERIC, null, null);
			System.out.println("driver : "+ sch.findDriverServingHIDDevice(PORT));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

@@ -998,32 +998,72 @@
 ger scm = null;%0A
+%09public static SerialComHID sch = null;%0A
 %09public static S
@@ -1073,32 +1073,32 @@
 ng PORT = null;%0A
-
 %09public static S
@@ -1205,31 +1205,9 @@
 ();%0A
-%09%09%09String PORT = null;
 %0A
+
 %09%09%09i
@@ -1304,12 +1304,12 @@
 /hid
-dev0
+raw1
 %22;%0A%09
@@ -1376,13 +1376,55 @@
  = %22
-COM51
+HID%5C%5CVID_04D8&PID_00DF&MI_02%5C%5C7&33842c3f&0&0000
 %22;%0A%09
@@ -1491,36 +1491,12 @@
 T = 
-%22/dev/cu.usbserial-A70362A3%22
+null
 ;%0A%09%09
@@ -1584,22 +1584,72 @@
 %7D%0A%09%09
-%09SerialComHID 
+%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%09try %7B%0A%09%09%09
 sch 
@@ -1844,14 +1844,210 @@
 e();%0A%09%09%7D
+%0A%0A%09%09try %7B%0A%09%09%09// windows mouse%0A%09%09%09System.out.println(%22driver : %22+ sch.findDriverServingHIDDevice(%22HID%5C%5CVID_04CA&PID_0061%5C%5C6&35F47D18&0&0000%22));%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D
 %0A%09%7D%0A%7D%0A

update test for finding hid device driver