20 lines
319 B
Python
20 lines
319 B
Python
import socket
|
|
import sys
|
|
|
|
commands = {
|
|
"speed": 0x01,
|
|
"power": 0x02,
|
|
}
|
|
|
|
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
client.connect(("10.42.50.102", 1337))
|
|
|
|
command = sys.argv[1]
|
|
value = int(sys.argv[2])
|
|
|
|
print(hex(value))
|
|
|
|
_ = client.send(bytes([commands[command], value, 0xFF]))
|
|
|
|
client.close()
|