1
0
mirror of https://github.com/JvanKatwijk/qt-dab.git synced 2025-10-06 00:02:40 +02:00
Files
SDR-DAB_Qt-DAB/helpers/tpeg-client/client.h

79 lines
2.1 KiB
C
Raw Normal View History

2024-03-21 15:52:32 +01:00
#
/*
* Copyright (C) 2015 .. 2023
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of Qt-DAB
*
* Qt-DAB 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.
*
* Qt-DAB 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 Qt-DAB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Communication via network to a DAB receiver to
* show the tdc data
*/
#pragma once
#include "constants.h"
#include <QDialog>
#include <QSettings>
#include <QLabel>
#include <QMessageBox>
#include <QTcpSocket>
#include <QHostAddress>
#include <QTimer>
#include "ui_widget.h"
#include "header-test.h"
//
2024-03-30 19:39:33 +01:00
#include <stdio.h>
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include "Python.h"
#include "numpy/arrayobject.h"
2024-03-21 15:52:32 +01:00
class Client:public QDialog, public Ui_widget {
Q_OBJECT
public:
Client (QWidget *parent = NULL);
~Client (void);
bool connected;
private slots:
void wantConnect ();
void setConnection ();
void readData ();
void handle (uint8_t);
void terminate ();
void timerTick ();
private:
void handleFrameType_0 (uint8_t *, int16_t);
void handleFrameType_1 (uint8_t *, int16_t);
bool serviceComponentFrameheaderCRC (uint8_t *data,
int16_t offset,
int16_t maxL);
2024-03-27 16:24:49 +01:00
void to_python (uint8_t *, int);
2024-03-21 15:52:32 +01:00
QTcpSocket streamer;
QTimer *connectionTimer;
headerTest headertester;
int16_t toRead;
int16_t dataLength;
uint8_t *dataBuffer;
uint8_t frameType;
int16_t dataIndex;
};