summaryrefslogtreecommitdiff
path: root/bluetoothgpsserver.h
blob: db5c25b057c32b2fae4a606730810436b2a6c10d (plain)
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
#ifndef BLUETOOTHGPSSERVER_H
#define BLUETOOTHGPSSERVER_H

#include <QtCore/QObject>
#include <QtCore/QList>

#include <QtBluetooth/QBluetoothSocket>
#include <QtBluetooth/QBluetoothServiceInfo>
#include <QtBluetooth/QRfcommServer>

QT_USE_NAMESPACE_BLUETOOTH

class NmeaSource;

class BluetoothGpsServer : public QObject
{
	Q_OBJECT
public:
	explicit BluetoothGpsServer(uint m_port, QObject *parent = 0);
	~BluetoothGpsServer();

signals:

public slots:
	void start();
	void stop();

protected slots:
	void sendData(const QString& data);
	void acceptConnection();
	void handleDisconnection();

private:
	uint m_port;
	NmeaSource* m_source;
	QBluetoothServiceInfo m_service;
	QRfcommServer* m_server;
	QList<QBluetoothSocket*> m_clients;
};

#endif // BLUETOOTHGPSSERVER_H