-
Notifications
You must be signed in to change notification settings - Fork 1
/
display_communication.h
executable file
·58 lines (52 loc) · 1.62 KB
/
display_communication.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
#ifndef DISPLAY_COMMUNICATION_H
#define DISPLAY_COMMUNICATION_H
#include <QObject>
#include <QWidget>
#include "header.h"
#include "music_streamer.h"
#include "database.h"
#include <QUdpSocket>
#include <QTcpSocket>
#include <QThread>
#include <QSerialPort>
#include <QTimer>
#define English '0'
#define Hindi '1'
#define Telugu '4'
/*class Sleeper : public QThread
{
public:
static void usleep(unsigned long usecs){QThread::usleep(usecs);}
static void msleep(unsigned long msecs){QThread::msleep(msecs);}
static void sleep(unsigned long secs){QThread::sleep(secs);}
};*/
class display_communication : public QObject
{
Q_OBJECT
public:
explicit display_communication(QObject *parent = 0);
~display_communication();
void device_reset();
void open_serialport();
database *emu_database;
music_streamer *announcements_streamer;
QTimer *hcd_timer;
QSerialPort *port;
signals:
void create_playlist(QString msg_code);
public slots:
void send_train_route_info(QString);
QByteArray generate_crc(unsigned char * buffer,unsigned int buffer_length);
QString replace_eng_delimiters(QString *eng_message);
QString replace_hindi_delimiters(QString *hindi_message);
QString replace_regional_delimiters(QString *regional_message);
void send_display_event_messages(QString func_code);
void send_headcode_frame();
void start_player();
void form_packet_for_transmission(QString dest_id, QString function_code,const char *packet_data, unsigned int data_length);
private:
QUdpSocket *server;
//QTcpSocket *server;
QByteArray data;
};
#endif // DISPLAY_COMMUNICATION_H