From 506f2e0c36f73d1b0d50d71c40c86636fc3b306f Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Thu, 19 May 2016 16:47:00 +0200 Subject: [PATCH] send real wire msgs in send_udp.py --- send_udp.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/send_udp.py b/send_udp.py index 6a19f0f84..cf7bce494 100755 --- a/send_udp.py +++ b/send_udp.py @@ -1,13 +1,23 @@ #!/usr/bin/python import socket import os +from binascii import unhexlify UDP_IP = os.getenv('TREZOR_UDP_IP', '127.0.0.1') UDP_PORT = int(os.getenv('TREZOR_UDP_PORT', '21324')) -MESSAGE = b'Hello, World!' + +INITIALIZE = b'?##\x00\x00\x00\x00\x00\x00' +GET_PUBLIC_KEY = b'?##\x00\x0b\x00\x00\x00\r\x12\tsecp256k1\x18\x00' +PIN_MATRIX_ACK = b'?##\x00\x13\x00\x00\x00\x05\n\x03268' + +messages = [ + INITIALIZE, + # GET_PUBLIC_KEY, + # PIN_MATRIX_ACK, +] sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -sock.sendto(MESSAGE, (UDP_IP, UDP_PORT)) +sock.sendto(messages.pop(0), (UDP_IP, UDP_PORT)) while True: print(sock.recv(64))