-
Notifications
You must be signed in to change notification settings - Fork 6
/
start_sil.py
68 lines (54 loc) · 1.47 KB
/
start_sil.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from tendo import singleton
import argparse
from stream.beast import BeastStream
from stream.avr import AVRStream
me = singleton.SingleInstance()
parser = argparse.ArgumentParser()
parser.add_argument(
"--host",
dest="host",
help="hostname or IP address, default:localhost",
default="127.0.0.1",
)
parser.add_argument("--port", dest="port", help="Network raw stream port")
parser.add_argument(
"--df-filter",
dest="df_filter",
nargs="+",
help="Downlink formats to save, defualt all: 0 4 5 11 16 17 18 19 20 21 24",
type=int,
)
parser.add_argument(
"--type",
dest="stream_type",
help="raw stream type, options are: beast or avr",
default="beast",
)
parser.add_argument(
"--buffer-size",
dest="buff_size",
help="Message buffer size, increas to lower write frequence to disk",
default=100,
type=int,
)
parser.add_argument(
"--output",
dest="output_dir",
help="output directory",
default=None
)
parser.add_argument("--debug", dest="debug", action="store_true", default=False)
args = parser.parse_args()
if args.stream_type.lower() == "beast":
stream = BeastStream(
args.host, args.port, df_filter=args.df_filter,
buff_size=args.buff_size,
output_dir=args.output_dir
)
if args.stream_type.lower() == "avr":
stream = AVRStream(
args.host, args.port, df_filter=args.df_filter, buff_size=args.buff_size
)
if args.debug:
stream.debug = True
stream.receive()