mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 07:08:05 -05:00
22 lines
479 B
Python
Executable File
22 lines
479 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import zmq
|
|
from pydrk import serial
|
|
|
|
context = zmq.Context()
|
|
socket = context.socket(zmq.REQ)
|
|
#self.socket.setsockopt(zmq.IPV6, True)
|
|
socket.connect(f"tcp://127.0.0.1:9484")
|
|
|
|
req_cmd = bytearray()
|
|
serial.write_u8(req_cmd, 0)
|
|
payload = bytearray()
|
|
socket.send_multipart([req_cmd, payload])
|
|
|
|
errc, reply = socket.recv_multipart()
|
|
errc = int.from_bytes(errc, "little")
|
|
cursor = serial.Cursor(reply)
|
|
response = serial.decode_str(cursor)
|
|
print(errc, response)
|
|
|