2018-01-23 16:31:42 +00:00
|
|
|
/*!
|
|
|
|
* \file labsat23_source.h
|
|
|
|
*
|
|
|
|
* \brief Unpacks the Labsat 2 (ls2) and (ls3) capture files
|
|
|
|
* \author Javier Arribas jarribas (at) cttc.es
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-05-13 20:49:11 +00:00
|
|
|
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
2018-01-23 16:31:42 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2018-01-23 20:48:42 +00:00
|
|
|
#ifndef GNSS_SDR_LABSAT23_SOURCE_H
|
|
|
|
#define GNSS_SDR_LABSAT23_SOURCE_H
|
2018-01-23 16:31:42 +00:00
|
|
|
|
|
|
|
#include <gnuradio/block.h>
|
2019-04-12 10:59:57 +00:00
|
|
|
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
|
2018-02-25 21:49:06 +00:00
|
|
|
#include <cstdint>
|
2018-01-23 16:31:42 +00:00
|
|
|
#include <fstream>
|
2018-02-25 21:49:06 +00:00
|
|
|
#include <string>
|
|
|
|
|
2018-01-23 16:31:42 +00:00
|
|
|
|
|
|
|
class labsat23_source;
|
|
|
|
|
2019-02-11 12:02:18 +00:00
|
|
|
using labsat23_source_sptr = boost::shared_ptr<labsat23_source>;
|
2018-01-23 16:31:42 +00:00
|
|
|
|
2019-07-01 21:44:42 +00:00
|
|
|
labsat23_source_sptr labsat23_make_source_sptr(
|
|
|
|
const char *signal_file_basename,
|
|
|
|
int channel_selector,
|
|
|
|
gr::msg_queue::sptr queue);
|
2018-01-23 16:31:42 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
|
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
class labsat23_source : public gr::block
|
2018-01-23 16:31:42 +00:00
|
|
|
{
|
2019-07-01 21:44:42 +00:00
|
|
|
public:
|
|
|
|
~labsat23_source();
|
|
|
|
|
|
|
|
int general_work(int noutput_items,
|
|
|
|
gr_vector_int &ninput_items,
|
|
|
|
gr_vector_const_void_star &input_items,
|
|
|
|
gr_vector_void_star &output_items);
|
|
|
|
|
2018-01-23 16:31:42 +00:00
|
|
|
private:
|
2019-07-01 21:44:42 +00:00
|
|
|
friend labsat23_source_sptr labsat23_make_source_sptr(
|
|
|
|
const char *signal_file_basename,
|
|
|
|
int channel_selector,
|
|
|
|
gr::msg_queue::sptr queue);
|
|
|
|
|
|
|
|
labsat23_source(const char *signal_file_basename,
|
|
|
|
int channel_selector,
|
|
|
|
gr::msg_queue::sptr queue);
|
|
|
|
|
2018-01-23 16:31:42 +00:00
|
|
|
std::string generate_filename();
|
2018-03-03 01:03:39 +00:00
|
|
|
void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type);
|
2018-01-23 16:31:42 +00:00
|
|
|
int getBit(uint8_t byte, int position);
|
|
|
|
bool d_header_parsed;
|
|
|
|
uint8_t d_channel_selector;
|
|
|
|
int d_channel_selector_config;
|
|
|
|
int d_current_file_number;
|
|
|
|
uint8_t d_labsat_version;
|
|
|
|
std::string d_signal_file_basename;
|
|
|
|
std::ifstream *binary_input_file;
|
|
|
|
uint8_t d_ref_clock;
|
|
|
|
uint8_t d_bits_per_sample;
|
2019-04-12 10:59:57 +00:00
|
|
|
gr::msg_queue::sptr d_queue;
|
2018-01-23 16:31:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|