add files
This commit is contained in:
parent
a6fb18a10b
commit
ceab1612ad
21 changed files with 46959 additions and 0 deletions
19
tnc_client.py
Normal file
19
tnc_client.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import socket
|
||||
import sys
|
||||
|
||||
def encode(data):
|
||||
return b"\xc0\x30%s\xc0" % data.replace(b"\xdb", b"\xdb\xdd").replace(b"\xc0", b"\xdb\xdc")
|
||||
|
||||
def main():
|
||||
sock = socket.socket()
|
||||
sock.connect(("192.168.4.1", 8000))
|
||||
while True:
|
||||
line = sys.stdin.readline()
|
||||
data = encode(line.encode("utf8"))
|
||||
print("sending %r" % data)
|
||||
sock.send(data)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue