Lines Matching defs:tn
66 tn.write("cat /proc/cpuinfo\n")
67 buf = tn.read_until("Returned 0", 3)
77 tn.write("cat /proc/mtd\n")
78 buf = tn.read_until("Returned 0", 3)
84 tn.write("flash_layout\n")
85 buf = tn.read_until("Returned 0", 3)
94 def image_dump(tn, dumpfile):
96 tn.write("ver\n");
97 buf = tn.read_until("Returned 0",2)
106 tn.write("rg_conf_print /dev/%s/mac\n" % device);
107 buf = tn.read_until("Returned 0",3)
117 tn.write("\n")
128 tn.write("flash_dump -r 0x%x -l %d -4\n" % (addr*dumplen, dumplen))
129 tn.read_until("\n")
133 buf = tn.read_until("\n")
144 tn.read_until(">",1)
215 tn = telnetlib.Telnet(HOST)
220 tn.set_option_negotiation_callback(telnet_option)
222 buf = tn.read_until("Username: ", 3)
225 tn.write(user+"\n")
227 buf = tn.read_until("Password: ", 3)
230 tn.write(password+"\n")
233 buf = tn.read_until("> ", 3)
240 image_dump(tn, dumpfile)
249 server = tn.get_socket().getsockname()[0]
264 tn.write("unlock 0 0x%x\n" % flashsize)
265 buf = tn.read_until("Returned 0",5)
270 tn.write(cmd)
271 buf = tn.read_until("Returned 0",10)
274 buf = tn.read_until("Download completed successfully",20)
278 tn.write("reboot\n")
281 tn.write("exit\n")
282 tn.close()