edl/Example/tcpclient.py

34 lines
802 B
Python
Raw Normal View History

2019-11-20 06:40:37 -05:00
#!/usr/bin/env python3
from edl.Library.tcpclient import tcpclient
class client():
def __init__(self):
self.commands=[]
def send(self):
2020-11-14 11:28:32 -05:00
self.tcp = tcpclient(1340)
self.tcp.sendcommands(self.commands)
def read(self,src):
self.commands.append(f"peekqword:{hex(src)}")
def write(self,dest,value):
self.commands.append(f"pokeqword:{hex(dest)},{hex(value)}")
def memcpy(self,dest,src,size):
self.commands.append(f"memcpy:{hex(dest)},{hex(src)},{hex(size)}")
def main():
exp=client()
exp.commands = [
2020-12-22 16:19:37 -05:00
"send:nop",
"r:boot,boot.img",
"peek:0x00100000,0x8,qfp.bin"
2020-11-14 11:28:32 -05:00
#"pokehex:0x1402C2CC,1f2003d5",
#"peek:0x14084840,0xC00,uart.bin"
]
exp.send()
if __name__=="__main__":
main()