Index: elec/CrO2/software/device_bekit.cpp
===================================================================
--- elec/CrO2/software/device_bekit.cpp	(revision e017851e1d36b1973f286e248d24668462f91445)
+++ elec/CrO2/software/device_bekit.cpp	(revision 6bd71447bd2bbe7f6fd3545561cdae4af7cebc79)
@@ -13,4 +13,18 @@
 #include <USBKit.h>
 
+class DeviceScanner: public BUSBRoster
+{
+	public:
+		DeviceScanner(uint32_t vid, uint32_t pid, const char* vendor, const char* product);
+
+		// BUSBRoster
+		status_t DeviceAdded(BUSBDevice* device);
+		void DeviceRemoved(BUSBDevice* device);
+
+		BUSBDevice* handle;
+	private:
+		uint32_t vid, pid;
+		const char* vendor, *product;
+};
 
 // Gets the device instance. Throws an error message if something bad happens.
@@ -18,5 +32,13 @@
 {
 	if (instance == NULL) {
-		instance = new HaikuDevice();
+		DeviceScanner* scanner = new DeviceScanner(vid, pid, vendor, product);
+
+		while(scanner->handle == NULL); // FIXME don't hog CPU, and timeout
+		//throw "Device not found. Is the USB cable plugged correctly?";
+
+		// We have our device, don't need the roster anymore.
+		delete scanner;
+
+		instance = new HaikuDevice(scanner->handle);
 	}
 
@@ -25,10 +47,7 @@
 
 
-HaikuDevice::HaikuDevice() throw(const char*)
+HaikuDevice::HaikuDevice(BUSBDevice* handle) throw(const char*)
 {
-	// At this point, either we have found a device and handle is pointing to it,
-	// or we failed and handle is NULL.
-	if (!handle)
-		throw "Device not found. Is the USB cable plugged correctly?";
+	this->handle = handle;
 }
 
@@ -67,5 +86,14 @@
 
 
-status_t HaikuDevice::DeviceAdded(BUSBDevice* device)
+DeviceScanner::DeviceScanner(uint32_t vid, uint32_t pid, const char* vendor, const char* product)
+	: vid(vid)
+	, pid(pid)
+	, vendor(vendor)
+	, product(product)
+{
+}
+
+
+status_t DeviceScanner::DeviceAdded(BUSBDevice* device)
 {
 	if (handle != NULL) {
@@ -94,5 +122,5 @@
 
 
-void HaikuDevice::DeviceRemoved(BUSBDevice* device)
+void DeviceScanner::DeviceRemoved(BUSBDevice* device)
 {
 	// This is only called for devices we accepted in DeviceAdded. We accept
Index: elec/CrO2/software/device_bekit.h
===================================================================
--- elec/CrO2/software/device_bekit.h	(revision e017851e1d36b1973f286e248d24668462f91445)
+++ elec/CrO2/software/device_bekit.h	(revision 6bd71447bd2bbe7f6fd3545561cdae4af7cebc79)
@@ -14,5 +14,5 @@
 class Tape;
 
-class HaikuDevice: public Device, BUSBRoster
+class HaikuDevice: public Device
 {
 	public:
@@ -25,9 +25,6 @@
 		uint8_t getStatus();
 
-		// BUSBRoster
-		status_t DeviceAdded(BUSBDevice* device);
-		void DeviceRemoved(BUSBDevice* device);
 	private:
-		HaikuDevice() throw(const char*);
+		HaikuDevice(BUSBDevice* handle) throw(const char*);
 			// Open device and set it up for communication
 		HaikuDevice(const Device& other);
Index: elec/CrO2/software/gui.cpp
===================================================================
--- elec/CrO2/software/gui.cpp	(revision e017851e1d36b1973f286e248d24668462f91445)
+++ elec/CrO2/software/gui.cpp	(revision 6bd71447bd2bbe7f6fd3545561cdae4af7cebc79)
@@ -20,20 +20,24 @@
 int pollStatus(Ihandle* ih)
 {
+	uint8_t status;
 	try {
-		Ihandle* motoron = (Ihandle*)IupGetAttribute(ih, "target");
-
-		uint8_t status = Device::getDevice().getStatus();
-		if (status & 8)
-			IupSetAttribute(motoron, "VALUE", "0"); // motor OFF
-		else
-			IupSetAttribute(motoron, "VALUE", "1"); // motor ON
-	} catch(const char*) {
+		Device& dev = Device::getDevice();
+		status = dev.getStatus();
+	} catch(const char* ex) {
 		// Silently ignore exception if device is not available - not a good
 		// idea to handle it from a timer...
 		// Keep the timer running so it starts working when the device is
 		// plugged
-	}
+		return IUP_DEFAULT;
+	}
+
+	Ihandle* motoron = (Ihandle*)IupGetAttribute(ih, "target");
+	if (status & 8)
+		IupSetAttribute(motoron, "VALUE", "0"); // motor OFF
+	else
+		IupSetAttribute(motoron, "VALUE", "1"); // motor ON
 	return IUP_DEFAULT;
 }
+
 
 void startPolling(Ihandle* target) {
