You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
import sys
|
|
from os import system
|
|
|
|
if __name__ == "__main__":
|
|
|
|
change_mode = False
|
|
if (len(sys.argv)) > 1:
|
|
# print("There are arguments!")
|
|
if (('d' == sys.argv[1]):
|
|
debug_mode = 1
|
|
try:
|
|
for line in sys.stdin:
|
|
if (debug_mode):
|
|
print(line)
|
|
|
|
# if '^c' == line.rstrip():
|
|
# break
|
|
|
|
if (line.find("MODE=a")) > 0:
|
|
system("echo 'APRS Mode!!'")
|
|
mode = 'a'
|
|
change_mode = True
|
|
if (line.find("MODE=f")) > 0:
|
|
system("echo 'FSK Mode!!'")
|
|
mode = 'f'
|
|
change_mode = True
|
|
if (line.find("MODE=b")) > 0:
|
|
system("echo 'BPSK Mode!!'")
|
|
mode = 'b'
|
|
change_mode = True
|
|
if (line.find("MODE=s")) > 0:
|
|
system("echo 'SSTV Mode!!'")
|
|
mode = 's'
|
|
change_mode = True
|
|
if (line.find("MODE=m")) > 0:
|
|
system("echo 'CW Mode!!'")
|
|
mode = 'm'
|
|
change_mode = True
|
|
if (debug_mode == True) and (change_mode == True):
|
|
print("/home/pi/CubeSatSim/config -" + mode)
|
|
system("/home/pi/CubeSatSim/config -" + mode)
|
|
change_mode = False
|
|
except:
|
|
print("Done")
|