+}
+
+void getCP210xDevices(ListDevice& devs)
+{
+ String ccs = "SYSTEM\\CurrentControlSet\\";
+ String enums = "Enum\\USB\\Vid_10c4&Pid_ea60";
+ RegKey dclass(HKEY_LOCAL_MACHINE, ccs+"Control\\DeviceClasses");
+ RegKey usb10c4(HKEY_LOCAL_MACHINE, ccs+enums);
+ RegKey usb10c4tty(HKEY_LOCAL_MACHINE, ccs+enums+"&Mi_00");
+
+ VecString cdev = usb10c4.getSubkeyNames();
+ for( VecString::const_iterator i=cdev.begin(); i!=cdev.end(); i++ )
+ {
+ Device d;
+ d.id = i->substr(0, 8);
+
+ try
+ {
+ RegKey devkey = usb10c4tty[*i+"_00"];
+ d.comm = devkey["Device Parameters"]("PortName").data;
+ }
+ catch( std::runtime_error e )
+ {
+ d.comm = "no_comm";
+ }
+
+ try { d.info = usb10c4[*i]("LocationInformation").data; }
+ catch( std::runtime_error e ) { }
+
+ try {
+ d.refcount = getRefCount( dclass, usb10c4[*i] );
+ }
+ catch( std::runtime_error e ) { }
+
+ String::size_type ncomm = d.comm.find_first_of("0123456789");
+ if( ncomm != String::npos )
+ d.sortnum = atoi( d.comm.substr(ncomm).c_str() );
+
+ devs.push_back(d);
+ }
+}
+
+
+ListDevice getDevices()
+{
+ ListDevice devs;
+
+ getFTDIDevices(devs);
+ getCP210xDevices(devs);