#s.setDTR(1) #s.flushInput() #while s.read(1024): # pass target = gdb.Target(s) except SerialException as e: print("FATAL: Failed to open serial device!\n%s\n" % e[0]) exit(-1) try: r = target.monitor("version") for s in r: print(s.decode(), end=' ') except SerialException as e: print("FATAL: Serial communication failure!\n%s\n" % e[0]) exit(-1) #except: pass print("Target device scan:") targetlist = None r = target.monitor(scan) for s in r: print(s.decode(), end=' ') print() r = target.monitor("targets") for s in r: if s.startswith(b"No. Att Driver"):