From 5aade3e1f58f8ea527f75682b56692383c864c77 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Thu, 2 Jun 2011 11:15:43 +0800 Subject: added debug output to write() method --- pyfantom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3