class CanSerial(Protocol): def __init__(self): self.packet = SerialPacket(self) print 'init' def connectionMade(self): print 'device is connected.' def cmdReceived(self, cmd): self.transport.write(cmd) # print 'send: '+cmd def dataReceived(self, data): # print 'dataReceived called with:' self.packet.recieve(str(data))
def __init__(self): self.packet = SerialPacket(self) print 'init'