aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-06-02 11:15:43 +0800
committerTat-Chee Wan (USM)2011-06-02 11:15:43 +0800
commit5aade3e1f58f8ea527f75682b56692383c864c77 (patch)
tree5a4bcb40e49b578491e979516864bbb5abb12364
parentf692b54b96e1f5480973a968a15a145f5a531881 (diff)
added debug output to write() method
-rw-r--r--pyfantom.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pyfantom.py b/pyfantom.py
index 86171cd..143da71 100644
--- a/pyfantom.py
+++ b/pyfantom.py
@@ -352,6 +352,8 @@ class NXT:
data_buffer = ctypes.create_string_buffer(data)
ret = dll.nFANTOM100_iNXT_write(self.handle, data_buffer, len(data),
cast(byref(status), POINTER(c_int)))
+ if self.debug:
+ print "pyfantom: write() sent ", ret, " of ", len(data), " bytes."
Status.check(status)
return ret
@@ -578,7 +580,7 @@ if __name__ == '__main__':
# check_bt == True: Bluetooth Interface
# check_bt == False: USB Interface
- check_bt = False
+ check_bt = True
get_info = True
play_tone = True
get_battery = True