Skip to content
Snippets Groups Projects
Commit c3f12611 authored by fxk8y's avatar fxk8y :spider:
Browse files

parent f626f3a3
No related branches found
No related tags found
No related merge requests found
......@@ -35,11 +35,23 @@ def send(x):
pass
t = 2 * 60**2 # seconds
countDown = True
t = 1 * 60**2 # seconds
bits = 10
if len(sys.argv) > 1:
if sys.argv[1] == 'up':
countDown = False
else:
countDown = True
else:
countDown = True
if len(sys.argv) > 2:
t = int(sys.argv[2]) * 60
bits = 16
step = 2**bits / t / 10 / 2**bits
print('step: ' + str(step))
......
......@@ -34,7 +34,7 @@ class Sender:
return struct.pack('f' * len(channels), *channels)
@classmethod
def _sendUDP(cls, data, host, port):
def _sendUDP(cls, data: bytearray, host: str, port: int = DEFAULT.port):
try:
cls._socket.sendto(data, (host, port))
except:
......@@ -42,13 +42,13 @@ class Sender:
pass
@classmethod
def sendTo(cls, channels, host, port):
def sendTo(cls, channels: list, host: str, port: int = DEFAULT.port):
data = DEFAULT.header
data += Sender._convertData(channels)
cls._sendUDP(data, host, port)
def send(self, channels):
def send(self, channels: list):
Sender.sendTo(channels, self._host, self._port)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment