mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-13 21:57:14 +00:00
Merge branch 'jeffmelville-labsat3w_unpack_fix' into next
This commit is contained in:
@@ -6,48 +6,41 @@
|
|||||||
|
|
||||||
|
|
||||||
# Optional drivers
|
# Optional drivers
|
||||||
set(OPT_DRIVER_SOURCES "")
|
|
||||||
set(OPT_DRIVER_HEADERS "")
|
|
||||||
|
|
||||||
if(ENABLE_RAW_UDP AND PCAP_FOUND)
|
if(ENABLE_RAW_UDP AND PCAP_FOUND)
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES custom_udp_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS custom_udp_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_PLUTOSDR)
|
if(ENABLE_PLUTOSDR)
|
||||||
##############################################
|
##############################################
|
||||||
# ADALM-PLUTO (Analog Devices Inc.)
|
# ADALM-PLUTO (Analog Devices Inc.)
|
||||||
##############################################
|
##############################################
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES plutosdr_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS plutosdr_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_FMCOMMS2)
|
if(ENABLE_FMCOMMS2)
|
||||||
###############################################
|
###############################################
|
||||||
# FMCOMMS2 based SDR Hardware
|
# FMCOMMS2 based SDR Hardware
|
||||||
###############################################
|
###############################################
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES fmcomms2_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS fmcomms2_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_AD9361)
|
if(ENABLE_AD9361)
|
||||||
###############################################
|
###############################################
|
||||||
# AD9361 DIRECT TO FPGA Hardware
|
# AD9361 DIRECT TO FPGA Hardware
|
||||||
###############################################
|
###############################################
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES ad9361_fpga_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS ad9361_fpga_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
|
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES flexiband_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS flexiband_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_ARRAY)
|
if(ENABLE_ARRAY)
|
||||||
##############################################
|
##############################################
|
||||||
# DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
|
# DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
|
||||||
@@ -56,32 +49,30 @@ if(ENABLE_ARRAY)
|
|||||||
message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc")
|
message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc")
|
||||||
message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled")
|
message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled")
|
||||||
endif()
|
endif()
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES raw_array_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS raw_array_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_OSMOSDR)
|
if(ENABLE_OSMOSDR)
|
||||||
################################################################################
|
################################################################################
|
||||||
# OsmoSDR - https://osmocom.org/projects/gr-osmosdr/
|
# OsmoSDR - https://osmocom.org/projects/gr-osmosdr/
|
||||||
################################################################################
|
################################################################################
|
||||||
if(GROSMOSDR_FOUND)
|
if(GROSMOSDR_FOUND)
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES osmosdr_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS osmosdr_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LIMESDR)
|
if(ENABLE_LIMESDR)
|
||||||
if(GRLIMESDR_FOUND)
|
if(GRLIMESDR_FOUND)
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} limesdr_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES limesdr_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} limesdr_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS limesdr_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_UHD)
|
if(ENABLE_UHD)
|
||||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
|
list(APPEND OPT_DRIVER_SOURCES uhd_signal_source.cc)
|
||||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS uhd_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_ZMQ)
|
if(ENABLE_ZMQ)
|
||||||
@@ -89,7 +80,6 @@ if(ENABLE_ZMQ)
|
|||||||
list(APPEND OPT_DRIVER_HEADERS zmq_signal_source.h)
|
list(APPEND OPT_DRIVER_HEADERS zmq_signal_source.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(SIGNAL_SOURCE_ADAPTER_SOURCES
|
set(SIGNAL_SOURCE_ADAPTER_SOURCES
|
||||||
signal_source_base.cc
|
signal_source_base.cc
|
||||||
file_source_base.cc
|
file_source_base.cc
|
||||||
@@ -218,7 +208,6 @@ if(ENABLE_LIMESDR AND GRLIMESDR_FOUND)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ENABLE_AD9361 AND LIBIIO_FOUND)
|
if(ENABLE_AD9361 AND LIBIIO_FOUND)
|
||||||
target_link_libraries(signal_source_adapters
|
target_link_libraries(signal_source_adapters
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@@ -302,8 +291,6 @@ target_compile_definitions(signal_source_adapters
|
|||||||
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set_property(TARGET signal_source_adapters
|
set_property(TARGET signal_source_adapters
|
||||||
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#if HAS_BOOST_ENDIAN
|
||||||
|
#include <boost/endian/conversion.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, const std::vector<int> &channel_selector, Concurrent_Queue<pmt::pmt_t> *queue, bool digital_io_enabled)
|
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, const std::vector<int> &channel_selector, Concurrent_Queue<pmt::pmt_t> *queue, bool digital_io_enabled)
|
||||||
{
|
{
|
||||||
@@ -737,7 +741,8 @@ void labsat23_source::decode_ls3w_register(uint64_t input, std::vector<gr_comple
|
|||||||
{
|
{
|
||||||
std::bitset<64> bs(input);
|
std::bitset<64> bs(input);
|
||||||
|
|
||||||
// Reverse, since register are written to file as 64-bit little endian words
|
// Earlier samples are written in the MSBs of the register. Bit-reverse the register
|
||||||
|
// for easier indexing. Note this bit-reverses individual samples as well for quant > 1 bit
|
||||||
for (std::size_t i = 0; i < 32; ++i)
|
for (std::size_t i = 0; i < 32; ++i)
|
||||||
{
|
{
|
||||||
bool t = bs[i];
|
bool t = bs[i];
|
||||||
@@ -1074,14 +1079,20 @@ int labsat23_source::general_work(int noutput_items,
|
|||||||
std::size_t output_pointer = 0;
|
std::size_t output_pointer = 0;
|
||||||
for (int i = 0; i < registers_to_read; i++)
|
for (int i = 0; i < registers_to_read; i++)
|
||||||
{
|
{
|
||||||
|
uint64_t read_register = 0ULL;
|
||||||
|
// Labsat3W writes its 64-bit shift register to files in little endian. Read and convert to host endianness.
|
||||||
|
#if HAS_BOOST_ENDIAN
|
||||||
|
binary_input_file.read(reinterpret_cast<char *>(&read_register), sizeof(read_register));
|
||||||
|
boost::endian::little_to_native_inplace(read_register);
|
||||||
|
#else
|
||||||
std::array<char, 8> memory_block{};
|
std::array<char, 8> memory_block{};
|
||||||
binary_input_file.read(memory_block.data(), 8);
|
binary_input_file.read(memory_block.data(), 8);
|
||||||
uint64_t read_register = 0ULL;
|
|
||||||
for (int k = 7; k >= 0; --k)
|
for (int k = 7; k >= 0; --k)
|
||||||
{
|
{
|
||||||
read_register <<= 8;
|
read_register <<= 8;
|
||||||
read_register |= uint64_t(memory_block[k]);
|
read_register |= uint64_t(memory_block[k]); // This is buggy if the MSB of the char is set.
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (binary_input_file.gcount() == 8)
|
if (binary_input_file.gcount() == 8)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user