diff -r 84f6f0592555 -r 646ee4dc3a6b slotUI/freeslot.py --- a/slotUI/freeslot.py Fri Dec 02 22:52:10 2011 +0100 +++ b/slotUI/freeslot.py Fri Dec 02 23:08:34 2011 +0100 @@ -3,3 +3,42 @@ Blackbox communication library """ +class SerialCommunicator(): + def __init__(self, device, speed): + self.device = device + self.speed = speed + self.port = None + self.connected = False + + def connect(self): + if self.connected: + return True + + def disconnect(self): + return True + + def write(self): + return True + + def read(self): + return True + +class Blackbox(): + def __init__(self): + self.com = None + self.info = None + + def connect(self, device="/dev/ttyUSB0", speed=115200): + if self.com == None: + self.com = SerialCommunicator(device, speed) + self.com.connect() + self.info = self.readinfo() + + def disconnect(): + self.com.disconnect() + + def readinfo(): + """ + Read complete Information from connected box + """ + return None \ No newline at end of file