2015-05-08 06:59:38 +00:00
|
|
|
/*!
|
|
|
|
* \file rtl_tcp_signal_source.h
|
|
|
|
* \brief Signal source which reads from rtl_tcp.
|
2020-02-05 20:24:46 +00:00
|
|
|
* (see https://osmocom.org/projects/rtl-sdr/wiki for more information)
|
2015-05-08 06:59:38 +00:00
|
|
|
* \author Anthony Arnold, 2015. anthony.arnold(at)uqconnect.edu.au
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-05-08 06:59:38 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2015-05-08 06:59:38 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2015-05-08 06:59:38 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-05-08 06:59:38 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
|
|
|
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
2015-05-08 06:59:38 +00:00
|
|
|
|
2019-07-16 15:41:12 +00:00
|
|
|
#include "concurrent_queue.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "rtl_tcp_signal_source_c.h"
|
2021-02-15 22:34:48 +00:00
|
|
|
#include "signal_source_base.h"
|
2015-05-08 06:59:38 +00:00
|
|
|
#include <gnuradio/blocks/deinterleave.h>
|
2018-12-09 21:00:09 +00:00
|
|
|
#include <gnuradio/blocks/file_sink.h>
|
2015-05-08 06:59:38 +00:00
|
|
|
#include <gnuradio/blocks/float_to_complex.h>
|
2019-07-16 15:41:12 +00:00
|
|
|
#include <pmt/pmt.h>
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
|
2015-05-08 06:59:38 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Signal_Source
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Signal_Source_adapters
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2015-05-08 06:59:38 +00:00
|
|
|
class ConfigurationInterface;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This class reads from rtl_tcp, which streams interleaved
|
|
|
|
* I/Q samples over TCP.
|
2020-02-05 20:24:46 +00:00
|
|
|
* (see https://osmocom.org/projects/rtl-sdr/wiki)
|
2015-05-08 06:59:38 +00:00
|
|
|
*/
|
2021-02-09 22:47:34 +00:00
|
|
|
class RtlTcpSignalSource : public SignalSourceBase
|
2015-05-08 06:59:38 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-06-29 07:07:41 +00:00
|
|
|
RtlTcpSignalSource(const ConfigurationInterface* configuration,
|
2018-12-03 18:01:47 +00:00
|
|
|
const std::string& role,
|
|
|
|
unsigned int in_stream,
|
|
|
|
unsigned int out_stream,
|
2020-06-18 09:49:28 +00:00
|
|
|
Concurrent_Queue<pmt::pmt_t>* queue);
|
2015-05-08 06:59:38 +00:00
|
|
|
|
2019-07-21 17:32:52 +00:00
|
|
|
~RtlTcpSignalSource() = default;
|
2015-05-08 06:59:38 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline size_t item_size() override
|
2015-05-08 06:59:38 +00:00
|
|
|
{
|
|
|
|
return item_size_;
|
|
|
|
}
|
|
|
|
|
2017-08-15 22:58:10 +00:00
|
|
|
void connect(gr::top_block_sptr top_block) override;
|
|
|
|
void disconnect(gr::top_block_sptr top_block) override;
|
|
|
|
gr::basic_block_sptr get_left_block() override;
|
|
|
|
gr::basic_block_sptr get_right_block() override;
|
2015-05-08 06:59:38 +00:00
|
|
|
|
|
|
|
private:
|
2017-08-25 17:17:12 +00:00
|
|
|
void MakeBlock();
|
2020-06-26 20:07:41 +00:00
|
|
|
|
|
|
|
rtl_tcp_signal_source_c_sptr signal_source_;
|
|
|
|
|
2020-11-03 19:51:57 +00:00
|
|
|
gnss_shared_ptr<gr::block> valve_;
|
2020-06-26 20:07:41 +00:00
|
|
|
gr::blocks::file_sink::sptr file_sink_;
|
|
|
|
|
|
|
|
std::string item_type_;
|
|
|
|
std::string dump_filename_;
|
2015-05-08 06:59:38 +00:00
|
|
|
|
|
|
|
// rtl_tcp settings
|
|
|
|
std::string address_;
|
2020-06-26 20:07:41 +00:00
|
|
|
size_t item_size_;
|
|
|
|
uint64_t samples_;
|
2022-12-05 22:18:33 +00:00
|
|
|
double rf_gain_;
|
2020-07-09 22:37:55 +00:00
|
|
|
int sample_rate_;
|
|
|
|
int freq_;
|
|
|
|
int gain_;
|
|
|
|
int if_gain_;
|
2020-06-26 20:07:41 +00:00
|
|
|
unsigned int in_stream_;
|
|
|
|
unsigned int out_stream_;
|
|
|
|
int16_t port_;
|
|
|
|
bool AGC_enabled_;
|
|
|
|
bool flip_iq_;
|
2015-05-08 06:59:38 +00:00
|
|
|
bool dump_;
|
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|