HackRF-Treasure-Chest/Software/Universal Radio Hacker/tests/data/external_program_simulator.py
2022-09-22 13:46:47 -07:00

20 lines
310 B
Python

#!/usr/bin/env python3
import sys
messages = sys.stdin.readlines()
# we get something like
# ->1010100000111111
# <-1000001111000000
message = messages[0]
direction = message[0:2]
if direction == "->":
result = "10" * int(sys.argv[1])
else:
result = "01" * int(sys.argv[1])
print(result, end="")