Lolitech@545: from LPCProto import * Lolitech@545: Lolitech@545: class LPCBootProto(LPCProto): Lolitech@545: def HandleTransaction(self, transaction): Lolitech@545: self.TransactionLock.acquire() Lolitech@545: try: Lolitech@545: transaction.SetPseudoFile(self.serialPort) Lolitech@545: res = transaction.ExchangeData() Lolitech@545: finally: Lolitech@545: self.TransactionLock.release() Lolitech@545: return "Stopped", res Lolitech@545: Lolitech@545: class LPCBootTransaction: Lolitech@545: def __init__(self, optdata = ""): Lolitech@545: self.OptData = optdata Lolitech@545: self.pseudofile = None Lolitech@545: Lolitech@545: def SetPseudoFile(self, pseudofile): Lolitech@545: self.pseudofile = pseudofile Lolitech@545: Lolitech@545: def SendData(self): Lolitech@548: res = self.pseudofile.write(self.OptData) Lolitech@548: return True Lolitech@545: Lolitech@545: def GetData(self): Lolitech@545: pass # not impl Lolitech@545: Lolitech@545: def ExchangeData(self): Lolitech@545: pass Lolitech@545: Lolitech@545: class LOADTransaction(LPCBootTransaction): Lolitech@545: def __init__(self, data): Lolitech@545: LPCBootTransaction.__init__(self, data) Lolitech@545: ExchangeData = LPCBootTransaction.SendData Lolitech@545: