+ def serInit(self, port=None, timeout=2, attemptlimit=None):
+ """Open a serial port of some kind."""
+ import re;
+
+ 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; #For debugging BT.
+ self.serialport=GoodFETbtser(port);
+
+ def pyserInit(self, port, timeout, attemptlimit):