2017-02-06 14:09:08 +01:00
|
|
|
#
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2015
|
|
|
|
* Jan van Katwijk (J.vanKatwijk@gmail.com)
|
2017-08-19 12:45:09 +02:00
|
|
|
* Lazy Chair Computing
|
2017-02-06 14:09:08 +01:00
|
|
|
*
|
2017-05-18 14:51:09 +02:00
|
|
|
* This file is part of the Qt-DAB
|
2020-04-12 19:08:56 +02:00
|
|
|
*
|
2017-05-18 14:51:09 +02:00
|
|
|
* Qt-DAB is free software; you can redistribute it and/or modify
|
2017-02-06 14:09:08 +01:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2017-05-18 14:51:09 +02:00
|
|
|
* Qt-DAB is distributed in the hope that it will be useful,
|
2017-02-06 14:09:08 +01:00
|
|
|
* 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
|
2017-05-18 14:51:09 +02:00
|
|
|
* along with Qt-DAB; if not, write to the Free Software
|
2017-02-06 14:09:08 +01:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
#
|
2023-09-20 21:17:22 +02:00
|
|
|
#pragma once
|
2017-02-06 14:09:08 +01:00
|
|
|
|
2018-01-03 18:46:52 +01:00
|
|
|
#include <vector>
|
2019-07-08 23:43:00 +02:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstring>
|
2017-02-06 14:09:08 +01:00
|
|
|
#include <QObject>
|
2023-10-24 14:36:30 +02:00
|
|
|
#include "frame-processor.h"
|
2017-08-19 12:45:09 +02:00
|
|
|
#include "ringbuffer.h"
|
2017-02-06 14:09:08 +01:00
|
|
|
|
|
|
|
class RadioInterface;
|
|
|
|
class virtual_dataHandler;
|
2018-02-12 11:10:54 +01:00
|
|
|
class packetdata;
|
2017-02-06 14:09:08 +01:00
|
|
|
|
2024-06-01 11:12:04 +02:00
|
|
|
class dataProcessor final :public QObject, public frameProcessor {
|
2017-02-06 14:09:08 +01:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
dataProcessor (RadioInterface *mr,
|
2018-02-12 11:10:54 +01:00
|
|
|
packetdata *pd,
|
2023-09-23 11:50:09 +02:00
|
|
|
RingBuffer<uint8_t> *dataBuffer,
|
|
|
|
bool backendFlag);
|
|
|
|
~dataProcessor ();
|
2023-12-20 14:06:41 +01:00
|
|
|
void addtoFrame (const std::vector<uint8_t>);
|
2017-02-06 14:09:08 +01:00
|
|
|
private:
|
|
|
|
RadioInterface *myRadioInterface;
|
|
|
|
int16_t bitRate;
|
|
|
|
uint8_t DSCTy;
|
2017-05-18 14:51:09 +02:00
|
|
|
int16_t appType;
|
2018-02-12 11:10:54 +01:00
|
|
|
int16_t packetAddress;
|
2017-02-06 14:09:08 +01:00
|
|
|
uint8_t DGflag;
|
|
|
|
int16_t FEC_scheme;
|
2017-08-19 12:45:09 +02:00
|
|
|
RingBuffer<uint8_t>* dataBuffer;
|
2017-05-18 14:51:09 +02:00
|
|
|
int16_t expectedIndex;
|
2018-01-06 19:37:34 +01:00
|
|
|
std::vector<uint8_t> series;
|
2017-02-06 14:09:08 +01:00
|
|
|
uint8_t packetState;
|
|
|
|
int32_t streamAddress; // int since we init with -1
|
|
|
|
//
|
|
|
|
// result handlers
|
2023-12-20 14:06:41 +01:00
|
|
|
void handleTDCAsyncstream (const uint8_t *, int32_t);
|
|
|
|
void handlePackets (const uint8_t *, int32_t);
|
|
|
|
void handlePacket (const uint8_t *);
|
2017-02-06 14:09:08 +01:00
|
|
|
virtual_dataHandler *my_dataHandler;
|
|
|
|
//
|
|
|
|
signals:
|
|
|
|
void show_mscErrors (int);
|
|
|
|
};
|
|
|
|
|
|
|
|
|