From: travisutk Date: Mon, 29 Aug 2011 00:27:21 +0000 (+0000) Subject: Bluetooth support. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=1733535635d911911b889d9096c282f4378af38b Bluetooth support. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1038 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/GoodFET.py b/client/GoodFET.py index ab6bb09..4e42bc5 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -72,12 +72,15 @@ class GoodFETbtser: sock.connect((btaddr,port)); sock.settimeout(10); #IMPORTANT Must be patient. - #Once connected, we need to get synced. - #This might require a firmware patch. - str=None; - while str!="http://goodfet.sf.net/": - str=self.read(64); - print str; + ##This is what we'd do for a normal reset. + #str=""; + #while not str.endswith("goodfet.sf.net/"): + # str=self.read(64); + # print str; + + # Instead, just return and hope for the best. + return; + def write(self,msg): """Send traffic.""" return self.sock.send(msg); @@ -109,14 +112,17 @@ class GoodFET: print "timeout\n"; def serInit(self, port=None, timeout=2, attemptlimit=None): """Open a serial port of some kind.""" + import re; - if port=="bluetooth" or os.environ.get("GOODFET")=="bluetooth": + if port==None: + port=os.environ.get("GOODFET"); + if port=="bluetooth" or (port is not None and re.match("..:..:..:..:..:..",port)): self.btInit(port,timeout,attemptlimit); else: self.pyserInit(port,timeout,attemptlimit); def btInit(self, port, timeout, attemptlimit): """Open a bluetooth port."""; - self.verbose=True; + #self.verbose=True; #For debugging BT. self.serialport=GoodFETbtser(port); def pyserInit(self, port, timeout, attemptlimit): diff --git a/client/goodfet.monitor b/client/goodfet.monitor index 8e90c59..d11b422 100755 --- a/client/goodfet.monitor +++ b/client/goodfet.monitor @@ -48,6 +48,10 @@ if(sys.argv[1]=="exec"): if(sys.argv[1]=="info"): client.monitor_info() +if(sys.argv[1]=="infotest"): + for foo in range(0,100): + client.monitor_info() + if(sys.argv[1]=="clocktest"): print "GoodFET with %s MCU" % client.infostring(); clocking=client.monitorgetclock();