aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus2011-10-09 18:40:21 +0000
committermarcus2011-10-09 18:40:21 +0000
commit9a445086e95c9c04ebeaa7b35161bd466ff3a7a5 (patch)
tree36b32cbfca0f2c6a5c00014be1e6a42263ed41c8
parent3e8647faafdd5fa196beaabcb1a986a7feacf460 (diff)
Fixed Issue 33. Thanks to Paul Hollensen!
-rw-r--r--nxt/usbsock.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/nxt/usbsock.py b/nxt/usbsock.py
index a56027b..de338b1 100644
--- a/nxt/usbsock.py
+++ b/nxt/usbsock.py
@@ -1,6 +1,7 @@
# nxt.usbsock module -- USB socket communication with LEGO Minstorms NXT
# Copyright (C) 2006, 2007 Douglas P Lau
# Copyright (C) 2009 Marcus Wanner
+# Copyright (C) 2011 Paul Hollensen, Marcus Wanner
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -12,7 +13,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-import usb
+import usb, os
from nxt.brick import Brick
ID_VENDOR_LEGO = 0x0694
@@ -43,7 +44,8 @@ class USBSock(object):
self.handle = self.device.open()
self.handle.setConfiguration(1)
self.handle.claimInterface(0)
- self.handle.reset()
+ if os.name != 'nt': # http://code.google.com/p/nxt-python/issues/detail?id=33
+ self.handle.reset()
if self.debug:
print 'Connected.'
return Brick(self)