Newer
Older
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
# -*- coding: utf-8 -*-
import os
import osmosdr
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import gr, blocks
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
class FileSink(self):
"""
FileSink class to create I/Q sample binary dump files.
"""
def __init__(self, dump_file, samp_rate, capture_time, device):
self.file_path = dump_file
self.sample_rate = samp_rate
self.freq = freq
self.capture_time = capture_time
self.capture_device = device
def needed_disc_space(self):
"""
Calculate needed disc space for dump.
"""
pass
def capture(self):
"""
Capture samples to dump file.
"""
pass
def _dump_file_writable(self):
"""
Check permissions for specified file dump path.
"""
if os.path.exists(self.pathfile):
return os.access(self.file_path, os.W_OK)
elif os.access(os.path.dirname(self.file_path), os.W_OK) and \
os.access(self.file_path, os.W_OK):
return True
else:
return False
def get_file_path(self):
return self.file_path
def get_samp_rate(self):
return samp_rate
def get_capture_time(self):
return self.capture_time
def get_capture_device(self):
return self.get_capture_device