remove mandatory pyrtlsdr dependency
This commit is contained in:
parent
0ced97e3eb
commit
7a4c465f7d
@ -1,8 +1,14 @@
|
||||
import time
|
||||
import traceback
|
||||
import numpy as np
|
||||
import pyModeS as pms
|
||||
from rtlsdr import RtlSdr
|
||||
import time
|
||||
|
||||
try:
|
||||
import rtlsdr
|
||||
except:
|
||||
print("------------------------------------------------------------------------")
|
||||
print("! Warining: pyrtlsdr not installed (required for using RTL-SDR devices) ")
|
||||
print("------------------------------------------------------------------------")
|
||||
|
||||
sampling_rate = 2e6
|
||||
smaples_per_microsec = 2
|
||||
@ -21,7 +27,7 @@ class RtlReader(object):
|
||||
def __init__(self, **kwargs):
|
||||
super(RtlReader, self).__init__()
|
||||
self.signal_buffer = [] # amplitude of the sample only
|
||||
self.sdr = RtlSdr()
|
||||
self.sdr = rtlsdr.RtlSdr()
|
||||
self.sdr.sample_rate = sampling_rate
|
||||
self.sdr.center_freq = modes_frequency
|
||||
self.sdr.gain = "auto"
|
||||
|
@ -7,11 +7,6 @@ import pyModeS as pms
|
||||
import traceback
|
||||
import zmq
|
||||
|
||||
if sys.version_info > (3, 0):
|
||||
PY_VERSION = 3
|
||||
else:
|
||||
PY_VERSION = 2
|
||||
|
||||
|
||||
class TcpClient(object):
|
||||
def __init__(self, host, port, datatype):
|
||||
@ -265,9 +260,6 @@ class TcpClient(object):
|
||||
try:
|
||||
received = [i for i in self.socket.recv(4096)]
|
||||
|
||||
if PY_VERSION == 2:
|
||||
received = [ord(i) for i in received]
|
||||
|
||||
self.buffer.extend(received)
|
||||
# print(''.join(x.encode('hex') for x in self.buffer))
|
||||
|
||||
|
2
setup.py
2
setup.py
@ -43,7 +43,7 @@ details = dict(
|
||||
],
|
||||
keywords="Mode-S ADS-B EHS ELS Comm-B",
|
||||
packages=find_packages(exclude=["contrib", "docs", "tests"]),
|
||||
install_requires=["numpy", "pyzmq", "pyrtlsdr"],
|
||||
install_requires=["numpy", "pyzmq"],
|
||||
package_data={"pyModeS": ["*.pyx", "*.pxd"]},
|
||||
scripts=["pyModeS/streamer/modeslive"],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user