forked from JvanKatwijk/channel-scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dab-processor.h
executable file
·97 lines (94 loc) · 2.73 KB
/
dab-processor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#
/*
* Copyright (C) 2016, 2017
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of channelScanner
*
* channelScanner 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 2 of the License, or
* (at your option) any later version.
*
* channelScanner 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
* along with channelScanner; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#
#ifndef __DAB_PROCESSOR__
#define __DAB_PROCESSOR__
/*
*
*/
#include "dab-constants.h"
#include <thread>
#include <atomic>
#include <stdint.h>
#include <vector>
#include "dab-params.h"
#include "phasereference.h"
#include "ofdm-decoder.h"
#include "fic-handler.h"
#include "ringbuffer.h"
#include "dab-api.h"
#include "sample-reader.h"
#include "tii_detector.h"
//
class deviceHandler;
class dabProcessor {
public:
dabProcessor (RingBuffer<std::complex<float>> *,
uint8_t, // Mode
callbacks *,
void *);
virtual ~dabProcessor (void);
void reset (void);
void stop (void);
void start (void);
void clearEnsemble (void);
uint16_t get_tiiData ();
uint16_t get_snr ();
void startDumping (SNDFILE *, int);
void stopDumping ();
void dataforAudioService (std::string, audiodata *);
void dataforAudioService (std::string,
audiodata *, int16_t);
void dataforDataService (std::string, packetdata *);
void dataforDataService (std::string,
packetdata *, int16_t);
int32_t get_SId (std::string);
private:
//
RingBuffer<std::complex<float>> *_I_Buffer;
callbacks *the_callBacks;
dabParams params;
sampleReader myReader;
phaseReference phaseSynchronizer;
ofdmDecoder my_ofdmDecoder;
ficHandler my_ficHandler;
tiiDetector my_tiiDetector;
std::thread threadHandle;
void *userData;
std::atomic<bool> running;
bool isSynced;
int snr;
int32_t T_null;
int32_t T_u;
int32_t T_s;
int32_t T_g;
int32_t T_F;
int32_t nrBlocks;
int32_t carriers;
int32_t carrierDiff;
bool wasSecond (int16_t, dabParams *);
int16_t mainId;
int16_t subId;
virtual void run (void);
};
#endif