summaryrefslogtreecommitdiff
path: root/bluetoothgpsserver.h
diff options
context:
space:
mode:
Diffstat (limited to 'bluetoothgpsserver.h')
-rw-r--r--bluetoothgpsserver.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/bluetoothgpsserver.h b/bluetoothgpsserver.h
new file mode 100644
index 0000000..db5c25b
--- /dev/null
+++ b/bluetoothgpsserver.h
@@ -0,0 +1,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