2016-05-08 04:00:37 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2016 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// This program 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 as version 3 of the License, or //
|
2019-04-11 12:32:15 +00:00
|
|
|
// (at your option) any later version. //
|
2016-05-08 04:00:37 +00:00
|
|
|
// //
|
|
|
|
// This program 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 V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef SDRBASE_DSP_DVSERIALENGINE_H_
|
|
|
|
#define SDRBASE_DSP_DVSERIALENGINE_H_
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-09-11 01:57:35 +00:00
|
|
|
#include <QMutex>
|
2016-05-08 04:00:37 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
|
2018-03-20 12:49:21 +00:00
|
|
|
#include "export.h"
|
2018-03-03 19:23:38 +00:00
|
|
|
|
2016-05-08 04:00:37 +00:00
|
|
|
class QThread;
|
|
|
|
class DVSerialWorker;
|
|
|
|
class AudioFifo;
|
|
|
|
|
2018-03-03 19:23:38 +00:00
|
|
|
class SDRBASE_API DVSerialEngine : public QObject
|
2016-05-08 04:00:37 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DVSerialEngine();
|
|
|
|
~DVSerialEngine();
|
|
|
|
|
|
|
|
bool scan();
|
|
|
|
void release();
|
|
|
|
|
|
|
|
int getNbDevices() const { return m_controllers.size(); }
|
2016-05-09 16:17:53 +00:00
|
|
|
void getDevicesNames(std::vector<std::string>& devicesNames);
|
|
|
|
|
2017-12-26 19:29:23 +00:00
|
|
|
void pushMbeFrame(
|
|
|
|
const unsigned char *mbeFrame,
|
|
|
|
int mbeRateIndex,
|
|
|
|
int mbeVolumeIndex,
|
|
|
|
unsigned char channels,
|
|
|
|
bool useHP,
|
2018-04-22 23:04:47 +00:00
|
|
|
int upsampling,
|
2017-12-26 19:29:23 +00:00
|
|
|
AudioFifo *audioFifo);
|
2016-05-08 04:00:37 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct DVSerialController
|
|
|
|
{
|
|
|
|
QThread *thread;
|
|
|
|
DVSerialWorker *worker;
|
|
|
|
std::string device;
|
|
|
|
};
|
|
|
|
|
2016-05-09 09:37:12 +00:00
|
|
|
#ifndef __WINDOWS__
|
2016-05-08 04:00:37 +00:00
|
|
|
static std::string get_driver(const std::string& tty);
|
|
|
|
static void register_comport(std::list<std::string>& comList, std::list<std::string>& comList8250, const std::string& dir);
|
|
|
|
static void probe_serial8250_comports(std::list<std::string>& comList, std::list<std::string> comList8250);
|
2016-05-09 09:37:12 +00:00
|
|
|
#endif
|
2016-05-08 04:00:37 +00:00
|
|
|
void getComList();
|
|
|
|
|
|
|
|
std::list<std::string> m_comList;
|
|
|
|
std::list<std::string> m_comList8250;
|
|
|
|
std::vector<DVSerialController> m_controllers;
|
2016-09-11 01:57:35 +00:00
|
|
|
QMutex m_mutex;
|
2016-05-08 04:00:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SDRBASE_DSP_DVSERIALENGINE_H_ */
|