mirror of
https://github.com/JvanKatwijk/dab-cmdline
synced 2025-10-05 23:52:50 +02:00
some refinements
This commit is contained in:
@@ -178,6 +178,7 @@ extern "C" {
|
|||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t dabMode;
|
uint8_t dabMode;
|
||||||
|
int16_t thresholdValue;
|
||||||
syncsignal_t syncsignal_Handler;
|
syncsignal_t syncsignal_Handler;
|
||||||
systemdata_t systemdata_Handler;
|
systemdata_t systemdata_Handler;
|
||||||
name_of_ensemble_t name_of_ensemble;
|
name_of_ensemble_t name_of_ensemble;
|
||||||
|
@@ -14,8 +14,7 @@
|
|||||||
* jan van Katwijk
|
* jan van Katwijk
|
||||||
* Lazy Chair Computing
|
* Lazy Chair Computing
|
||||||
*/
|
*/
|
||||||
#ifndef __AIRSPY_HANDLER__
|
#pragma once
|
||||||
#define __AIRSPY_HANDLER__
|
|
||||||
|
|
||||||
#include "ringbuffer.h"
|
#include "ringbuffer.h"
|
||||||
#include "device-handler.h"
|
#include "device-handler.h"
|
||||||
@@ -151,7 +150,6 @@ static
|
|||||||
int callback(airspy_transfer_t *);
|
int callback(airspy_transfer_t *);
|
||||||
int data_available (void *buf, int buf_size);
|
int data_available (void *buf, int buf_size);
|
||||||
const char * getSerial (void);
|
const char * getSerial (void);
|
||||||
int open (void);
|
int open (void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -4,8 +4,7 @@
|
|||||||
// different readers, with one "mother" reader.
|
// different readers, with one "mother" reader.
|
||||||
// Note that the cardreader is quite different here
|
// Note that the cardreader is quite different here
|
||||||
// and its code is elsewhere
|
// and its code is elsewhere
|
||||||
#ifndef __COMMON_READERS
|
#pragma once
|
||||||
#define __COMMON_READERS
|
|
||||||
|
|
||||||
#include "virtual-reader.h"
|
#include "virtual-reader.h"
|
||||||
|
|
||||||
@@ -49,5 +48,4 @@ private:
|
|||||||
int16_t convIndex;
|
int16_t convIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -21,8 +21,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef __EXTIO_HANDLER_
|
#pragma once
|
||||||
#define __EXTIO_HANDLER_
|
|
||||||
#
|
#
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
@@ -229,5 +228,4 @@ private:
|
|||||||
signals:
|
signals:
|
||||||
// The following signals originate from the Winrad Extio interface
|
// The following signals originate from the Winrad Extio interface
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -3,8 +3,7 @@
|
|||||||
// For the different formats for input, we have
|
// For the different formats for input, we have
|
||||||
// different readers, with one "mother" reader.
|
// different readers, with one "mother" reader.
|
||||||
// Note that the cardreader is quite different here
|
// Note that the cardreader is quite different here
|
||||||
#ifndef __READER
|
#pragma once
|
||||||
#define __READER
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -162,5 +161,4 @@ int16_t bitDepth (void) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -3,8 +3,7 @@
|
|||||||
// For the different formats for input, we have
|
// For the different formats for input, we have
|
||||||
// different readers, with one "mother" reader.
|
// different readers, with one "mother" reader.
|
||||||
// Note that the cardreader is quite different here
|
// Note that the cardreader is quite different here
|
||||||
#ifndef __VIRTUAL_READER
|
#pragma once
|
||||||
#define __VIRTUAL_READER
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -39,5 +38,4 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -3,23 +3,20 @@
|
|||||||
* Copyright (C) 2015
|
* Copyright (C) 2015
|
||||||
* Sebastian Held <sebastian.held@imst.de>
|
* Sebastian Held <sebastian.held@imst.de>
|
||||||
*
|
*
|
||||||
* This file is part of the SDR-J.
|
* This file is adapted for use with dab-cmdline
|
||||||
* Many of the ideas as implemented in SDR-J are derived from
|
|
||||||
* other work, made available through the GNU general Public License.
|
|
||||||
* All copyrights of the original authors are recognized.
|
|
||||||
*
|
*
|
||||||
* SDR-J is free software; you can redistribute it and/or modify
|
* dab-cmdline is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* SDR-J is distributed in the hope that it will be useful,
|
* dab-cmdline is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with SDR-J; if not, write to the Free Software
|
* along with dab-cmdline; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "uhd-input.h"
|
#include "uhd-input.h"
|
||||||
@@ -59,7 +56,7 @@ void uhd_streamer::stop (void) {
|
|||||||
wait(1);
|
wait(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uhd_streamer::run (void) {
|
void uhd_streamer::run () {
|
||||||
while (!m_stop_signal_called) {
|
while (!m_stop_signal_called) {
|
||||||
// get write position, ignore data2 and size2
|
// get write position, ignore data2 and size2
|
||||||
int32_t size1, size2;
|
int32_t size1, size2;
|
||||||
@@ -153,7 +150,7 @@ void uhd_streamer::run (void) {
|
|||||||
*success = true;
|
*success = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uhdInput::~uhdInput (void) {
|
uhdInput::~uhdInput () {
|
||||||
if (theBuffer != NULL) {
|
if (theBuffer != NULL) {
|
||||||
stopReader();
|
stopReader();
|
||||||
uhdSettings -> beginGroup ("uhdSettings");
|
uhdSettings -> beginGroup ("uhdSettings");
|
||||||
@@ -181,7 +178,7 @@ int32_t freq = m_usrp -> get_rx_freq ();
|
|||||||
return freq;
|
return freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool uhdInput::restartReader (void) {
|
bool uhdInput::restartReader () {
|
||||||
if (m_workerHandle != 0)
|
if (m_workerHandle != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -201,7 +198,7 @@ void uhdInput::stopReader (void) {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
// not used:
|
// not used:
|
||||||
uint8_t uhdInput::myIdentity (void) {
|
uint8_t uhdInput::myIdentity () {
|
||||||
return DAB_STICK;
|
return DAB_STICK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,11 +209,11 @@ int32_t uhdInput::getSamples (DSPCOMPLEX *v, int32_t size) {
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t uhdInput::Samples (void) {
|
int32_t uhdInput::Samples () {
|
||||||
return theBuffer -> GetRingBufferReadAvailable();
|
return theBuffer -> GetRingBufferReadAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void uhdInput::resetBuffer (void) {
|
void uhdInput::resetBuffer () {
|
||||||
theBuffer -> FlushRingBuffer();
|
theBuffer -> FlushRingBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +221,7 @@ void uhdInput::set_fCorrection (int32_t f) {
|
|||||||
(void)f;
|
(void)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t uhdInput::maxGain (void) {
|
int16_t uhdInput::maxGain () {
|
||||||
uhd::gain_range_t range = m_usrp->get_rx_gain_range();
|
uhd::gain_range_t range = m_usrp->get_rx_gain_range();
|
||||||
return range.stop();
|
return range.stop();
|
||||||
}
|
}
|
||||||
@@ -240,7 +237,7 @@ void uhdInput::set_KhzOffset (int32_t o) {
|
|||||||
vfoOffset = o;
|
vfoOffset = o;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t uhdInput::bitDepth (void) {
|
int16_t uhdInput::bitDepth () {
|
||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,8 +22,7 @@
|
|||||||
* along with SDR-J; if not, write to the Free Software
|
* along with SDR-J; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef __UHDINPUT
|
#pragma once
|
||||||
#define __UHDINPUT
|
|
||||||
|
|
||||||
#include "virtual-input.h"
|
#include "virtual-input.h"
|
||||||
|
|
||||||
@@ -55,19 +54,19 @@ Q_OBJECT
|
|||||||
friend class uhd_streamer;
|
friend class uhd_streamer;
|
||||||
public:
|
public:
|
||||||
uhdInput (QSettings *dabSettings, bool *success);
|
uhdInput (QSettings *dabSettings, bool *success);
|
||||||
virtual ~uhdInput (void);
|
virtual ~uhdInput ();
|
||||||
virtual void setVFOFrequency (int32_t freq);
|
virtual void setVFOFrequency (int32_t freq);
|
||||||
virtual int32_t getVFOFrequency (void);
|
virtual int32_t getVFOFrequency ();
|
||||||
bool legalFrequency (int32_t) {return true;}
|
bool legalFrequency (int32_t) {return true;}
|
||||||
int32_t defaultFrequency (void) {return 100000000;}
|
int32_t defaultFrequency () {return 100000000;}
|
||||||
virtual bool restartReader (void);
|
virtual bool restartReader ();
|
||||||
virtual void stopReader (void);
|
virtual void stopReader ();
|
||||||
virtual int32_t getSamples (DSPCOMPLEX *, int32_t size);
|
virtual int32_t getSamples (DSPCOMPLEX *, int32_t size);
|
||||||
virtual int32_t Samples (void);
|
virtual int32_t Samples ();
|
||||||
uint8_t myIdentity (void);
|
uint8_t myIdentity ();
|
||||||
virtual void resetBuffer (void);
|
virtual void resetBuffer ();
|
||||||
virtual int16_t maxGain (void);
|
virtual int16_t maxGain ();
|
||||||
int16_t bitDepth (void);
|
int16_t bitDepth ();
|
||||||
//
|
//
|
||||||
private:
|
private:
|
||||||
QSettings *uhdSettings;
|
QSettings *uhdSettings;
|
||||||
@@ -83,5 +82,4 @@ private slots:
|
|||||||
void set_fCorrection (int);
|
void set_fCorrection (int);
|
||||||
void set_KhzOffset (int);
|
void set_KhzOffset (int);
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -21,8 +21,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __XML_DESCRIPTOR__
|
#pragma once
|
||||||
#define __XML_DESCRIPTOR__
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -71,4 +70,3 @@ public:
|
|||||||
void add_modtoBlock (int blockno, std::string modType);
|
void add_modtoBlock (int blockno, std::string modType);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -20,8 +20,7 @@
|
|||||||
* along with DAB library; if not, write to the Free Software
|
* along with DAB library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef __XML_FILEREADER__
|
#pragma once
|
||||||
#define __XML_FILEREADER__
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
@@ -54,5 +53,4 @@ private:
|
|||||||
xml_Reader *theReader;
|
xml_Reader *theReader;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
@@ -20,8 +20,7 @@
|
|||||||
* along with eti-cmdline; if not, write to the Free Software
|
* along with eti-cmdline; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef __XML_READER__
|
#pragma once
|
||||||
#define __XML_READER__
|
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -75,4 +74,3 @@ private:
|
|||||||
float mapTable_float [2048];
|
float mapTable_float [2048];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -4,20 +4,20 @@
|
|||||||
* Jan van Katwijk (J.vanKatwijk@gmail.com)
|
* Jan van Katwijk (J.vanKatwijk@gmail.com)
|
||||||
* Lazy Chair Computing
|
* Lazy Chair Computing
|
||||||
*
|
*
|
||||||
* This file is part of eti-cmdline
|
* This file is part of dab-cmdline
|
||||||
*
|
*
|
||||||
* eti-cmdline is free software; you can redistribute it and/or modify
|
* dab-cmdline is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* eti-cmdline is distributed in the hope that it will be useful,
|
* dab-cmdline is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with eti-cmdline; if not, write to the Free Software
|
* along with dab-cmdline; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -300,6 +300,7 @@ deviceHandler *theDevice;
|
|||||||
// and with a sound device we now can create a "backend"
|
// and with a sound device we now can create a "backend"
|
||||||
API_struct interface;
|
API_struct interface;
|
||||||
interface. dabMode = theMode;
|
interface. dabMode = theMode;
|
||||||
|
interface. thresholdValue = 10;
|
||||||
interface. syncsignal_Handler = syncsignalHandler;
|
interface. syncsignal_Handler = syncsignalHandler;
|
||||||
interface. systemdata_Handler = systemData;
|
interface. systemdata_Handler = systemData;
|
||||||
interface. ensemblename_Handler = ensemblename_Handler;
|
interface. ensemblename_Handler = ensemblename_Handler;
|
||||||
|
@@ -145,11 +145,11 @@ void serviceName (const std::string &s, int SId,
|
|||||||
static
|
static
|
||||||
void programdata_Handler (audiodata *d, void *ctx) {
|
void programdata_Handler (audiodata *d, void *ctx) {
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
std::cerr << "\tstartaddress\t= " << d -> startAddr << "\n";
|
// std::cerr << "\tstartaddress\t= " << d -> startAddr << "\n";
|
||||||
std::cerr << "\tlength\t\t= " << d -> length << "\n";
|
// std::cerr << "\tlength\t\t= " << d -> length << "\n";
|
||||||
std::cerr << "\tsubChId\t\t= " << d -> subchId << "\n";
|
// std::cerr << "\tsubChId\t\t= " << d -> subchId << "\n";
|
||||||
std::cerr << "\tprotection\t= " << d -> protLevel << "\n";
|
// std::cerr << "\tprotection\t= " << d -> protLevel << "\n";
|
||||||
std::cerr << "\tbitrate\t\t= " << d -> bitRate << "\n";
|
// std::cerr << "\tbitrate\t\t= " << d -> bitRate << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -263,59 +263,59 @@ uint8_t theBand = BAND_III;
|
|||||||
int lnaGain = 40;
|
int lnaGain = 40;
|
||||||
int vgaGain = 40;
|
int vgaGain = 40;
|
||||||
int ppmOffset = 0;
|
int ppmOffset = 0;
|
||||||
const char *optionsString = "D:d:M:B:P:O:A:C:G:g:p:";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:g:p:";
|
||||||
#elif HAVE_LIME
|
#elif HAVE_LIME
|
||||||
int16_t gain = 70;
|
int16_t gain = 70;
|
||||||
std::string antenna = "Auto";
|
std::string antenna = "Auto";
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:g:X:";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:g:X:";
|
||||||
#elif HAVE_PLUTO
|
#elif HAVE_PLUTO
|
||||||
int16_t gain = 60;
|
int16_t gain = 60;
|
||||||
bool autogain = true;
|
bool autogain = true;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:Q";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:Q";
|
||||||
#elif HAVE_SDRPLAY
|
#elif HAVE_SDRPLAY
|
||||||
int16_t GRdB = 30;
|
int16_t GRdB = 30;
|
||||||
int16_t lnaState = 4;
|
int16_t lnaState = 4;
|
||||||
bool autogain = true;
|
bool autogain = true;
|
||||||
int16_t ppmOffset = 0;
|
int16_t ppmOffset = 0;
|
||||||
bool X_dump = false;
|
bool X_dump = false;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:L:Qp:X";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:L:Qp:X";
|
||||||
#elif HAVE_SDRPLAY_V3
|
#elif HAVE_SDRPLAY_V3
|
||||||
int16_t GRdB = 30;
|
int16_t GRdB = 30;
|
||||||
int16_t lnaState = 3;
|
int16_t lnaState = 3;
|
||||||
bool autogain = false;
|
bool autogain = false;
|
||||||
int16_t ppmOffset = 0;
|
int16_t ppmOffset = 0;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:L:Qp:X";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:L:Qp:X";
|
||||||
bool X_dump = false;
|
bool X_dump = false;
|
||||||
#elif HAVE_AIRSPY
|
#elif HAVE_AIRSPY
|
||||||
int16_t gain = 20;
|
int16_t gain = 20;
|
||||||
bool autogain = false;
|
bool autogain = false;
|
||||||
bool rf_bias = false;
|
bool rf_bias = false;
|
||||||
int16_t ppmOffset = 0;
|
int16_t ppmOffset = 0;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:p:b";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:p:b";
|
||||||
#elif HAVE_RTLSDR
|
#elif HAVE_RTLSDR
|
||||||
int16_t gain = 50;
|
int16_t gain = 50;
|
||||||
bool autogain = false;
|
bool autogain = false;
|
||||||
int16_t ppmOffset = 0;
|
int16_t ppmOffset = 0;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:p:Q";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:p:Q";
|
||||||
#elif HAVE_WAVFILES
|
#elif HAVE_WAVFILES
|
||||||
std::string fileName;
|
std::string fileName;
|
||||||
bool repeater = true;
|
bool repeater = true;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:F:R:";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:F:R:";
|
||||||
#elif HAVE_RAWFILES
|
#elif HAVE_RAWFILES
|
||||||
std::string fileName;
|
std::string fileName;
|
||||||
bool repeater = true;
|
bool repeater = true;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:F:R:";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:F:R:";
|
||||||
#elif HAVE_XMLFILES
|
#elif HAVE_XMLFILES
|
||||||
std::string fileName;
|
std::string fileName;
|
||||||
bool repeater = true;
|
bool repeater = true;
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:F:R:";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:F:R:";
|
||||||
#elif HAVE_RTL_TCP
|
#elif HAVE_RTL_TCP
|
||||||
int gain = 50;
|
int gain = 50;
|
||||||
bool autogain = false;
|
bool autogain = false;
|
||||||
int ppmOffset = 0;
|
int ppmOffset = 0;
|
||||||
std::string hostname = "127.0.0.1"; // default
|
std::string hostname = "127.0.0.1"; // default
|
||||||
int32_t basePort = 1234; // default
|
int32_t basePort = 1234; // default
|
||||||
const char *optionsString = "T:D:d:M:B:P:O:A:C:G:Qp:H:I";
|
const char *optionsString = "t:T:D:d:M:B:P:O:A:C:G:Qp:H:I";
|
||||||
#endif
|
#endif
|
||||||
std::string soundChannel = "default";
|
std::string soundChannel = "default";
|
||||||
int16_t latency = 10;
|
int16_t latency = 10;
|
||||||
@@ -325,7 +325,7 @@ int opt;
|
|||||||
struct sigaction sigact;
|
struct sigaction sigact;
|
||||||
bandHandler dabBand;
|
bandHandler dabBand;
|
||||||
deviceHandler *theDevice = nullptr;
|
deviceHandler *theDevice = nullptr;
|
||||||
|
int16_t thresholdValue = 6; // default;
|
||||||
bool err;
|
bool err;
|
||||||
int theDuration = -1; // no limit
|
int theDuration = -1; // no limit
|
||||||
//tiiHandler the_tiiHandler;
|
//tiiHandler the_tiiHandler;
|
||||||
@@ -345,6 +345,9 @@ int theDuration = -1; // no limit
|
|||||||
fprintf (stderr, "options are %s\n", optionsString);
|
fprintf (stderr, "options are %s\n", optionsString);
|
||||||
while ((opt = getopt (argc, argv, optionsString)) != -1) {
|
while ((opt = getopt (argc, argv, optionsString)) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
case 't':
|
||||||
|
thresholdValue = atoi (optarg);
|
||||||
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
theDuration = 60 * atoi (optarg); // minutes
|
theDuration = 60 * atoi (optarg); // minutes
|
||||||
break;
|
break;
|
||||||
@@ -649,6 +652,7 @@ int theDuration = -1; // no limit
|
|||||||
// and with a sound device we now can create a "backend"
|
// and with a sound device we now can create a "backend"
|
||||||
API_struct interface;
|
API_struct interface;
|
||||||
interface. dabMode = theMode;
|
interface. dabMode = theMode;
|
||||||
|
interface. thresholdValue = thresholdValue;
|
||||||
interface. syncsignal_Handler = syncsignalHandler;
|
interface. syncsignal_Handler = syncsignalHandler;
|
||||||
interface. systemdata_Handler = systemData;
|
interface. systemdata_Handler = systemData;
|
||||||
interface. name_of_ensemble = name_of_ensemble;
|
interface. name_of_ensemble = name_of_ensemble;
|
||||||
|
@@ -45,7 +45,7 @@ void tiiHandler::run () {
|
|||||||
if (known (xx))
|
if (known (xx))
|
||||||
continue;
|
continue;
|
||||||
if ((xx. ecc == 0) || (xx. EId == 0)) {
|
if ((xx. ecc == 0) || (xx. EId == 0)) {
|
||||||
fprintf (stderr, "No further data: %d %d \n",
|
fprintf (stderr, "No further data available to decode: %d %d \n",
|
||||||
xx. mainId,
|
xx. mainId,
|
||||||
xx. subId);
|
xx. subId);
|
||||||
tiiTable. push_back (xx);
|
tiiTable. push_back (xx);
|
||||||
@@ -60,13 +60,14 @@ void tiiHandler::run () {
|
|||||||
|
|
||||||
cacheElement *handle = lookup (xx); // in tii database
|
cacheElement *handle = lookup (xx); // in tii database
|
||||||
if (handle == nullptr)
|
if (handle == nullptr)
|
||||||
fprintf (stderr, "not found %X %d %d\n",
|
fprintf (stderr, "not found in database %X %d %d\n",
|
||||||
xx. EId, xx. mainId, xx. subId);
|
xx. EId, xx. mainId, xx. subId);
|
||||||
else
|
else
|
||||||
fprintf (stderr, " %X %d %d -> %s %s %s %s %f %f (%d %d %d\n",
|
fprintf (stderr, " %X %d %d\t-> %f %s %s %s %s %f %f (%d %d %d)\n",
|
||||||
handle -> Eid,
|
handle -> Eid,
|
||||||
handle -> mainId,
|
handle -> mainId,
|
||||||
handle -> subId,
|
handle -> subId,
|
||||||
|
xx. strength,
|
||||||
handle -> country. c_str (),
|
handle -> country. c_str (),
|
||||||
handle -> channel. c_str (),
|
handle -> channel. c_str (),
|
||||||
handle -> ensemble. c_str (),
|
handle -> ensemble. c_str (),
|
||||||
|
@@ -567,6 +567,7 @@ deviceHandler *theDevice;
|
|||||||
// and with a sound device we now can create a "backend"
|
// and with a sound device we now can create a "backend"
|
||||||
API_struct interface;
|
API_struct interface;
|
||||||
interface. dabMode = theMode;
|
interface. dabMode = theMode;
|
||||||
|
interface. thresholdValue = 6;
|
||||||
interface. syncsignal_Handler = syncsignal_Handler;
|
interface. syncsignal_Handler = syncsignal_Handler;
|
||||||
interface. systemdata_Handler = systemData;
|
interface. systemdata_Handler = systemData;
|
||||||
interface. name_of_ensemble = name_of_ensemble;
|
interface. name_of_ensemble = name_of_ensemble;
|
||||||
|
@@ -490,6 +490,7 @@ int theDuration = -1; // infinite
|
|||||||
// and with a sound device we now can create a "backend"
|
// and with a sound device we now can create a "backend"
|
||||||
API_struct interface;
|
API_struct interface;
|
||||||
interface. dabMode = theMode;
|
interface. dabMode = theMode;
|
||||||
|
interface. thresholdValue = 6;
|
||||||
interface. syncsignal_Handler = syncsignal_Handler;
|
interface. syncsignal_Handler = syncsignal_Handler;
|
||||||
interface. systemdata_Handler = systemData;
|
interface. systemdata_Handler = systemData;
|
||||||
interface. name_of_ensemble = name_of_ensemble;
|
interface. name_of_ensemble = name_of_ensemble;
|
||||||
|
@@ -463,6 +463,7 @@ bool err;
|
|||||||
// and with a sound device we can create a "backend"
|
// and with a sound device we can create a "backend"
|
||||||
API_struct interface;
|
API_struct interface;
|
||||||
interface. dabMode = theMode;
|
interface. dabMode = theMode;
|
||||||
|
interface. thresholdValue = 6;
|
||||||
interface. syncsignal_Handler = syncsignal_Handler;
|
interface. syncsignal_Handler = syncsignal_Handler;
|
||||||
interface. systemdata_Handler = systemData;
|
interface. systemdata_Handler = systemData;
|
||||||
interface. name_of_ensemble = name_of_ensemble;
|
interface. name_of_ensemble = name_of_ensemble;
|
||||||
|
@@ -297,6 +297,7 @@ bool err;
|
|||||||
// and with a sound device we now can create a "backend"
|
// and with a sound device we now can create a "backend"
|
||||||
API_struct interface;
|
API_struct interface;
|
||||||
interface. dabMode = theMode;
|
interface. dabMode = theMode;
|
||||||
|
interface. thresholdValue = 6;
|
||||||
interface. syncsignal_Handler = syncsignalHandler;
|
interface. syncsignal_Handler = syncsignalHandler;
|
||||||
interface. systemdata_Handler = systemData;
|
interface. systemdata_Handler = systemData;
|
||||||
interface. name_of_ensemble = name_of_ensemble;
|
interface. name_of_ensemble = name_of_ensemble;
|
||||||
|
@@ -349,7 +349,7 @@ stream_parms streamParameters;
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf (stderr, "CRC failure with dab+ frame should not happen\n");
|
// fprintf (stderr, "CRC failure with dab+ frame should not happen\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -383,7 +383,8 @@ void padHandler::build_MSC_segment (std::vector<uint8_t> data) {
|
|||||||
int32_t size = (int)(data. size ()) <
|
int32_t size = (int)(data. size ()) <
|
||||||
dataGroupLength ? data. size () :
|
dataGroupLength ? data. size () :
|
||||||
dataGroupLength;
|
dataGroupLength;
|
||||||
|
if (size <= 2)
|
||||||
|
return;
|
||||||
uint8_t groupType = data [0] & 0xF;
|
uint8_t groupType = data [0] & 0xF;
|
||||||
uint8_t continuityIndex = (data [1] & 0xF) >> 4;
|
uint8_t continuityIndex = (data [1] & 0xF) >> 4;
|
||||||
uint8_t repetitionIndex = data [1] & 0xF;
|
uint8_t repetitionIndex = data [1] & 0xF;
|
||||||
|
@@ -66,7 +66,7 @@
|
|||||||
this -> carriers = params. get_carriers ();
|
this -> carriers = params. get_carriers ();
|
||||||
this -> carrierDiff = params. get_carrierDiff ();
|
this -> carrierDiff = params. get_carrierDiff ();
|
||||||
this -> tii_counter = 0;
|
this -> tii_counter = 0;
|
||||||
this -> threshold = 6;
|
this -> threshold = p -> thresholdValue;
|
||||||
isSynced = false;
|
isSynced = false;
|
||||||
snr = 0;
|
snr = 0;
|
||||||
running. store (false);
|
running. store (false);
|
||||||
|
@@ -19,6 +19,10 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with DAB library; if not, write to the Free Software
|
* along with DAB library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
* This implementation of the TII decoder is a modified version
|
||||||
|
* of the TII decoder used in Qt-DAB, which is itself derived
|
||||||
|
* from the TII decoder is DABstar and was developed by Rolf Zerr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tii-detector.h"
|
#include "tii-detector.h"
|
||||||
@@ -109,7 +113,7 @@ uint8_t patternTable [] = {
|
|||||||
0360 // 1 1 1 1 0 0 0 0 69
|
0360 // 1 1 1 1 0 0 0 0 69
|
||||||
};
|
};
|
||||||
|
|
||||||
TII_Detector::TII_Detector (uint8_t dabMode):
|
TII_Detector::TII_Detector (uint8_t dabMode):
|
||||||
params (dabMode),
|
params (dabMode),
|
||||||
theTable (dabMode),
|
theTable (dabMode),
|
||||||
T_u (params. get_T_u ()),
|
T_u (params. get_T_u ()),
|
||||||
@@ -154,7 +158,7 @@ void TII_Detector::addBuffer (const std::vector<Complex> &v) {
|
|||||||
Complex tmpBuffer [T_u];
|
Complex tmpBuffer [T_u];
|
||||||
|
|
||||||
for (int i = 0; i < T_u; i ++)
|
for (int i = 0; i < T_u; i ++)
|
||||||
tmpBuffer [i] = v [T_g + i];
|
tmpBuffer [i] = v [T_g + i] * window [i];
|
||||||
my_fftHandler. fft (tmpBuffer);
|
my_fftHandler. fft (tmpBuffer);
|
||||||
for (int i = 0; i < T_u; i ++)
|
for (int i = 0; i < T_u; i ++)
|
||||||
nullSymbolBuffer [i] += tmpBuffer [i];
|
nullSymbolBuffer [i] += tmpBuffer [i];
|
||||||
@@ -214,10 +218,7 @@ int fcmp (const void *a, const void *b) {
|
|||||||
if (element1 -> strength > element2 -> strength)
|
if (element1 -> strength > element2 -> strength)
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
if (element1 -> strength < element2 -> strength)
|
return (element1 -> strength < element2 -> strength) ? 1 : 0;
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<tiiData> TII_Detector::processNULL (int16_t threshold_db) {
|
std::vector<tiiData> TII_Detector::processNULL (int16_t threshold_db) {
|
||||||
|
Reference in New Issue
Block a user