29 QObject::connect( socket, SIGNAL( connected() ),
this, SLOT( connected() ) );
30 QObject::connect( socket, SIGNAL( error( QAbstractSocket::SocketError ) ),
this, SLOT( error( QAbstractSocket::SocketError ) ) );
39 void QgsGpsdConnection::connected()
43 socket->
write(
QString(
"?WATCH={\"enable\":true,\"nmea\":true,\"raw\":true%1};" ).arg( mDevice.
isEmpty() ? mDevice :
QString(
",\"device\":%1" ).
arg( mDevice ) ).toUtf8() );
46 void QgsGpsdConnection::error( QAbstractSocket::SocketError socketError )
52 Q_UNUSED( socketError );
QString errorString() const
void connectToHost(const QString &hostName, quint16 port, QFlags< QIODevice::OpenModeFlag > openMode)
Evaluates NMEA sentences coming from a GPS device.
QgsGpsdConnection(const QString &host, qint16 port, const QString &device)
QIODevice * mSource
Data source (e.g.
qint64 write(const char *data, qint64 maxSize)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const