Ver código fonte

add tool/tool_ntripbroadcast. but not complete.

yuchuli 3 anos atrás
pai
commit
a8c6ca684a

+ 9 - 5
src/driver/driver_ntrip_client/ntrip_client.cpp

@@ -1,5 +1,7 @@
 #include "ntrip_client.h"
 
+#include <memory>
+
 ntrip_client::ntrip_client(std::string strip,std::string strport,std::string strMountPoint,
                            std::string strUserName,std::string strPassWord,
                            std::string strCOMName,int nBaudRate )
@@ -64,6 +66,7 @@ void ntrip_client::readyReadSlot()
     char * str;
 
     QByteArray message = socket_->readAll();
+
 //    qDebug(message.data());
 
     switch (mFindCMState) {
@@ -123,8 +126,6 @@ void ntrip_client::readyReadSlot()
     qDebug(strX);*/
 //    qDebug("TIME = %d read meesage length = %d",mTime.elapsed() ,message.length());
 
-
-
 }
 
 void ntrip_client::errorSlot(QAbstractSocket::SocketError)
@@ -239,15 +240,18 @@ void ntrip_client::onTimerPortOpen()
 
 void ntrip_client::ShowNtripMsg(QByteArray ba)
 {
-    char strout[3000];
-    snprintf(strout,3000,"Ntrip msg len is %d info is:",ba.length());
+    if(ba.size()<1)return;
+    char * strout = 0;
+    std::shared_ptr<char> str_ptr = std::shared_ptr<char>(new char[ba.size()*3 + 100]);
+    strout = str_ptr.get();
+    snprintf(strout,3000,"Ntrip msg len is %d info is: ",ba.length());
     char strtem[10];
     int nlen = ba.length();
     int i;
     for(i=0;i<nlen;i++)
     {
         snprintf(strtem,10,"%02X ",(unsigned char )ba.at(i));
-        strncat(strout,strtem,3000);
+        strncat(strout,strtem,10);
     }
     qDebug(strout);
 }

+ 73 - 0
src/tool/tool_ntripbroadcast/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 11 - 0
src/tool/tool_ntripbroadcast/main.cpp

@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+    return a.exec();
+}

+ 114 - 0
src/tool/tool_ntripbroadcast/mainwindow.cpp

@@ -0,0 +1,114 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    ui->lineEdit_serverip->setText(mstrserverip);
+    ui->lineEdit_serverport->setText(mstrserverport);
+    ui->lineEdit_servermountpoint->setText(mstrservermountpoint);
+    ui->lineEdit_username->setText(mstrusername);
+    ui->lineEdit_password->setText(mstrpassword);
+
+    ui->lineEdit_Lon->setText(QString::number(mfLon,'f',7));
+    ui->lineEdit_Lat->setText(QString::number(mfLat,'f',7));
+
+    mpntripclient = new ntrip_client(ui->lineEdit_serverip->text().toStdString(),
+                               ui->lineEdit_serverport->text().toStdString(),
+                               ui->lineEdit_servermountpoint->text().toStdString(),
+                               ui->lineEdit_username->text().toStdString(),
+                               ui->lineEdit_password->text().toStdString());
+
+    connect(mpntripclient,SIGNAL(updatentripmsg(QByteArray)),this,SLOT(onupdatentripmsg(QByteArray)));
+
+    setWindowTitle(mstrAppTitle);
+
+    QTimer * timer = new QTimer(this);
+    connect(timer,SIGNAL(timeout()),this,SLOT(onTimer()));
+    timer->start(100);
+
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+
+
+void MainWindow::on_pushButton_Start_clicked()
+{
+    if(mbStart)
+    {
+        ui->pushButton_Start->setText("Start");
+        mbStart = false;
+        mpntripclient->StopConnect();
+
+    }
+    else
+    {
+        ui->pushButton_Start->setText("Stop");
+        mbStart = true;
+        mpntripclient->setserverinfo(ui->lineEdit_serverip->text().toStdString(),
+                                   ui->lineEdit_serverport->text().toStdString(),
+                                   ui->lineEdit_servermountpoint->text().toStdString(),
+                                   ui->lineEdit_username->text().toStdString(),
+                                   ui->lineEdit_password->text().toStdString());
+
+        double flon = ui->lineEdit_Lon->text().toDouble();
+        double flat = ui->lineEdit_Lat->text().toDouble();
+
+
+        mpntripclient->SetLatLon(flon,flat);
+        mpntripclient->StartConnect();
+    }
+}
+
+void MainWindow::onTimer()
+{
+    if(mbStart == false)
+    {
+        QString strtitle = mstrAppTitle + "  Stopped";
+        setWindowTitle(strtitle);
+    }
+    else
+    {
+        QString strtitle = mstrAppTitle;
+        int nstate = mpntripclient->GetState();
+        if(nstate<0)
+        {
+            strtitle = strtitle + "PassWord Error.";
+        }
+        else
+        {
+            if(nstate == 5)strtitle = strtitle + " Connected to Server";
+            else
+            {
+                strtitle = strtitle + " Connecting. State is "+ QString::number(nstate);
+            }
+        }
+        setWindowTitle(strtitle);
+    }
+}
+
+void MainWindow::onupdatentripmsg(QByteArray ba)
+{
+    if(ba.size()<1)return;
+    char * strout = 0;
+    std::shared_ptr<char> str_ptr = std::shared_ptr<char>(new char[ba.size()*3 + 100]);
+    strout = str_ptr.get();
+    snprintf(strout,3000,"Ntrip msg len is %d info is: ",ba.length());
+    char strtem[10];
+    int nlen = ba.length();
+    int i;
+    for(i=0;i<nlen;i++)
+    {
+        snprintf(strtem,10,"%02X ",(unsigned char )ba.at(i));
+        strncat(strout,strtem,10);
+    }
+
+    ui->plainTextEdit_NTIPMSG->setPlainText(strout);
+}

+ 48 - 0
src/tool/tool_ntripbroadcast/mainwindow.h

@@ -0,0 +1,48 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+#include "ntrip_client.h"
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = nullptr);
+    ~MainWindow();
+
+
+
+private slots:
+    void on_pushButton_Start_clicked();
+    void onTimer();
+    void onupdatentripmsg(QByteArray ba);
+
+private:
+    Ui::MainWindow *ui;
+
+    QString mstrserverip = "cors.qq.com";
+    QString mstrserverport = "8002";
+    QString mstrservermountpoint = "RTCM32";
+    QString mstrusername = "chinaauto";
+    QString mstrpassword = "chinaauto@test";
+
+    double mfLat = 39.1207274;
+    double mfLon = 117.0280033;
+
+    bool mbStart = false;
+
+    ntrip_client * mpntripclient;
+
+    QString mstrAppTitle = "NTRIP BroadCast";
+
+};
+#endif // MAINWINDOW_H

+ 232 - 0
src/tool/tool_ntripbroadcast/mainwindow.ui

@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1038</width>
+    <height>674</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="ntrip.qrc">
+    <normaloff>:/ntripbroad.png</normaloff>:/ntripbroad.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QPushButton" name="pushButton_Start">
+    <property name="geometry">
+     <rect>
+      <x>540</x>
+      <y>334</y>
+      <width>89</width>
+      <height>31</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Start</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_serverip">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>30</y>
+      <width>261</width>
+      <height>31</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_serverport">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>90</y>
+      <width>261</width>
+      <height>31</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_servermountpoint">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>150</y>
+      <width>261</width>
+      <height>31</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_username">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>210</y>
+      <width>261</width>
+      <height>31</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>40</y>
+      <width>141</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Server IP</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>100</y>
+      <width>101</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Server Port</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_3">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>160</y>
+      <width>121</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>MountPoint</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_4">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>220</y>
+      <width>121</width>
+      <height>17</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>User Name</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_password">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>270</y>
+      <width>261</width>
+      <height>31</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_5">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>280</y>
+      <width>121</width>
+      <height>17</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>PassWord</string>
+    </property>
+   </widget>
+   <widget class="QPlainTextEdit" name="plainTextEdit_Client">
+    <property name="geometry">
+     <rect>
+      <x>660</x>
+      <y>30</y>
+      <width>291</width>
+      <height>331</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QPlainTextEdit" name="plainTextEdit_NTIPMSG">
+    <property name="geometry">
+     <rect>
+      <x>80</x>
+      <y>390</y>
+      <width>871</width>
+      <height>221</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_6">
+    <property name="geometry">
+     <rect>
+      <x>110</x>
+      <y>340</y>
+      <width>71</width>
+      <height>17</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>经度</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_Lon">
+    <property name="geometry">
+     <rect>
+      <x>170</x>
+      <y>340</y>
+      <width>151</width>
+      <height>25</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_7">
+    <property name="geometry">
+     <rect>
+      <x>340</x>
+      <y>340</y>
+      <width>41</width>
+      <height>17</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>纬度</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_Lat">
+    <property name="geometry">
+     <rect>
+      <x>390</x>
+      <y>340</y>
+      <width>141</width>
+      <height>25</height>
+     </rect>
+    </property>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>1038</width>
+     <height>28</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources>
+  <include location="ntrip.qrc"/>
+ </resources>
+ <connections/>
+</ui>

+ 5 - 0
src/tool/tool_ntripbroadcast/ntrip.qrc

@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>ntripbroad.png</file>
+    </qresource>
+</RCC>

+ 258 - 0
src/tool/tool_ntripbroadcast/ntrip_client.cpp

@@ -0,0 +1,258 @@
+#include "ntrip_client.h"
+
+#include <memory>
+
+ntrip_client::ntrip_client(std::string strip,std::string strport,std::string strMountPoint,
+                           std::string strUserName,std::string strPassWord)
+{
+    mstrip = strip;
+    mstrport = strport;
+    mstrMountPoint = strMountPoint;
+    mstrUserName = strUserName;
+    mstrPassWord = strPassWord;
+
+    socket_ = new QTcpSocket(this);
+//    socket_->connectToHost("rtk.ntrip.qxwz.com",8002);
+    connect(socket_, SIGNAL(connected()), this, SLOT(connectedSlot()));
+    connect(socket_, SIGNAL(disconnected()), this, SLOT(disconnectedSlot()));
+    connect(socket_, SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
+    connect(socket_, SIGNAL(error(QAbstractSocket::SocketError)), this,
+            SLOT(errorSlot(QAbstractSocket::SocketError)));
+
+    mpTimerNtrip = new QTimer(this);
+    connect(mpTimerNtrip,SIGNAL(timeout()),this,SLOT(onTimerNtrip()));
+    mpTimerNtrip->setInterval(1000);
+    mpTimerNtrip->start();
+
+}
+
+void ntrip_client::setserverinfo(std::string strip, std::string strport, std::string strMountPoint, std::string strUserName, std::string strPassWord)
+{
+    mstrip = strip;
+    mstrport = strport;
+    mstrMountPoint = strMountPoint;
+    mstrUserName = strUserName;
+    mstrPassWord = strPassWord;
+}
+
+void ntrip_client::run()
+{
+
+}
+
+
+void ntrip_client::connectedSlot()
+{
+    if(socket_->state() == QAbstractSocket::ConnectedState)
+    {
+        qDebug("main is connected.\n");
+        mFindCMState = 3;
+    }
+    else
+    {
+        qDebug("main is not connected.\n");
+    }
+    isConnected_ = true;
+}
+
+void ntrip_client::disconnectedSlot()
+{
+//    qDebug("connect server fail.");
+    if(mFindCMState != -1)mFindCMState = 0;
+    isConnected_ = false;
+    socket_->close();
+
+}
+
+void ntrip_client::readyReadSlot()
+{
+    char * str;
+
+    QByteArray message = socket_->readAll();
+
+//    qDebug(message.data());
+
+    switch (mFindCMState) {
+
+    case 4:
+        str = (char *)message.data();
+        if(strstr(str,"ICY 200 OK") > 0)
+        {
+            mFindCMState = 5;
+            qDebug("Login succcess");
+        }
+        else
+        {
+            if(strstr(str,"HTTP 401 Unauthorized") > 0)
+            {
+                mFindCMState = -1;
+                qDebug("Authorize Fail. message is %s",message.data());
+            }
+         //   mFindCMState = 0;
+        }
+        break;
+    case 5:
+        emit updatentripmsg(message);
+#ifdef  DEBUG_NTRIP_MSG
+        ShowNtripMsg(message);
+#else
+        qDebug("ntrip msg len is %d",message.length());
+#endif
+
+
+        break;
+    default:
+        break;
+    }
+
+
+}
+
+void ntrip_client::errorSlot(QAbstractSocket::SocketError)
+{
+//    QMessageBox::information(this, "show", socket_->errorString());
+    disconnectedSlot();
+}
+
+
+void ntrip_client::onTimerNtrip()
+{
+    if(mbConnect == false)
+    {
+        if(mFindCMState != 0)
+        {
+            disconnectedSlot();
+        }
+        return;
+    }
+    switch (mFindCMState) {
+    case -1:
+//        mpTimerNtrip->stop();
+//        qDebug("User Pass Word Error.");
+        break;
+    case 0:
+        socket_->connectToHost(mstrip.data(),atoi(mstrport.data()));
+        mFindCMState = 1;
+        break;
+    case 2:
+        break;
+    case 3:
+        SendUserPass();
+        mFindCMState = 4;
+        break;
+    case 4:
+        break;
+    case 5:
+        SendGPGGA();
+        break;
+    default:
+        break;
+    }
+}
+
+void ntrip_client::SendUserPass()
+{
+    char strSend[1000];
+ //   snprintf(strSend,1000,"GET / HTTP/1.0\r\nUser-Agent: NTRIP GNSSInternetRadio/1.4.10\r\nAccept: */*\r\nConnection: close\r\n\r\n");
+    char strLine[100];
+    char strX[1000];
+    snprintf(strX,1000,"%s:%s",mstrUserName.data(),mstrPassWord.data());
+    QByteArray ba; ba.append(strX);qDebug(ba.toBase64().data());
+    snprintf(strSend,1000,"GET /%s HTTP/1.0\r\n",mstrMountPoint.data());
+    snprintf(strLine,100,"User-Agent: NTRIP GNSSInternetRadio/1.4.10\r\n");strncat(strSend,strLine,1000);
+    snprintf(strLine,100,"Accept: */*\r\n");strncat(strSend,strLine,1000);
+    snprintf(strLine,100,"Connection: close\r\n");strncat(strSend,strLine,1000);
+    snprintf(strLine,100,"Authorization: Basic %s\r\n",ba.toBase64().data());strncat(strSend,strLine,1000);
+    snprintf(strLine,100,"\r\n");strncat(strSend,strLine,1000);
+    socket_->write(strSend,strlen(strSend));
+    socket_->flush();
+}
+
+void ntrip_client::SendGPGGA()
+{
+    char strSend[1000];
+    double flon = mfLon;
+    double flat = mfLat;
+    double flon_deg = flon - (double)((int)flon);
+    double flat_deg = flat - (double)((int)flat);
+    flon_deg = 60.0*flon_deg;
+    flat_deg = 60.0*flat_deg;
+    flon = (double)((int)flon);
+    flat = (double)((int)flat);
+    flon = flon*100.0 + flon_deg;
+    flat = flat*100.0 + flat_deg;
+
+    char strgga[1000];
+
+    QDateTime dt = QDateTime::currentDateTime();
+    snprintf(strgga,1000,"$GPGGA,%02d%02d%02d.%03d,%11.7f,N,%11.7f,E,1,13,1.5,46.4085,M,-9.452,M,99,AAAA",
+             dt.time().hour(),dt.time().minute(),dt.time().second(),dt.time().msec(),flat,flon);
+    char check = calccheck(strgga);
+    snprintf(strSend,1000,"%s*%02X\r\n",strgga,check);
+    qDebug(strSend);
+    socket_->write(strSend,strlen(strSend));
+    socket_->flush();
+
+
+
+}
+
+void ntrip_client::ShowNtripMsg(QByteArray ba)
+{
+    if(ba.size()<1)return;
+    char * strout = 0;
+    std::shared_ptr<char> str_ptr = std::shared_ptr<char>(new char[ba.size()*3 + 100]);
+    strout = str_ptr.get();
+    snprintf(strout,3000,"Ntrip msg len is %d info is: ",ba.length());
+    char strtem[10];
+    int nlen = ba.length();
+    int i;
+    for(i=0;i<nlen;i++)
+    {
+        snprintf(strtem,10,"%02X ",(unsigned char )ba.at(i));
+        strncat(strout,strtem,10);
+    }
+    qDebug(strout);
+}
+
+int ntrip_client::GetState()
+{
+    return mFindCMState;
+}
+
+void ntrip_client::StartConnect()
+{
+    mbConnect = true;
+}
+
+void ntrip_client::StopConnect()
+{
+    mbConnect = false;
+}
+
+void ntrip_client::SetGGA(char *strgga)
+{
+    mMutexstrgga.lock();
+    strncpy(mstrgga,strgga,1000);
+    mMutexstrgga.unlock();
+}
+
+void ntrip_client::SetLatLon(double flon, double flat)
+{
+    mfLon = flon;
+    mfLat = flat;
+
+}
+
+char ntrip_client::calccheck(const char *strsen)
+{
+    int nlen = strnlen(strsen,1000);
+    int i;
+    char check;
+    check = strsen[1]^strsen[2];
+    for(i=3;i<nlen;i++)
+    {
+        check = check^strsen[i];
+    }
+    return check;
+}

+ 82 - 0
src/tool/tool_ntripbroadcast/ntrip_client.h

@@ -0,0 +1,82 @@
+#ifndef NTRIP_CLIENT_H
+#define NTRIP_CLIENT_H
+
+
+#include <QObject>
+#include <QThread>
+#include <QDateTime>
+#include <QTimer>
+#include <iostream>
+#include <QMutex>
+
+#include <QUdpSocket>
+#include <QNetworkDatagram>
+#include <QtNetwork/QTcpSocket>
+
+
+
+class ntrip_client : public QThread
+{
+        Q_OBJECT
+public:
+    ntrip_client(std::string strip,std::string strport,std::string strMountPoint,
+                 std::string strUserName,std::string strPassWord);
+
+    void setserverinfo(std::string strip,std::string strport,std::string strMountPoint,
+                       std::string strUserName,std::string strPassWord);
+
+    static char calccheck(const char * strsen);
+
+signals:
+    void updatentripmsg(QByteArray ba);
+private slots:
+    void connectedSlot();
+    void disconnectedSlot();
+    void readyReadSlot();
+    void errorSlot(QAbstractSocket::SocketError);
+
+    void onTimerNtrip();
+
+private:
+    std::string mstrip;
+    std::string mstrport;
+    std::string mstrMountPoint;
+    std::string mstrUserName;
+    std::string mstrPassWord;
+    std::string mstrCOMName;
+    int mnBaudRate;
+
+    int mFindCMState = 0; //-1 Pass Error 0 not connected 1 connecting 2 connected 3 need send pass 4 had send usernamepassword 5 connected
+    QTcpSocket *socket_;
+    bool isConnected_;
+    int mSerialState;
+
+    char mstrgga[1000];
+    QMutex mMutexstrgga;
+    QTimer * mpTimerNtrip;
+
+
+private:
+    void SendUserPass();
+    void SendGPGGA();
+
+    void ShowNtripMsg(QByteArray ba);
+
+
+private:
+    void run();
+
+    bool mbConnect = false;
+
+    double mfLon,mfLat;
+
+public:
+    int GetState();
+    void StartConnect();
+    void StopConnect();
+    void SetGGA(char * strgga);
+    void SetLatLon(double flon,double flat);
+
+};
+
+#endif // NTRIP_CLIENT_H

BIN
src/tool/tool_ntripbroadcast/ntripbroad.png


+ 36 - 0
src/tool/tool_ntripbroadcast/tool_ntripbroadcast.pro

@@ -0,0 +1,36 @@
+QT       += core gui network
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++11
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    main.cpp \
+    mainwindow.cpp \
+    ntrip_client.cpp
+
+HEADERS += \
+    mainwindow.h \
+    ntrip_client.h
+
+FORMS += \
+    mainwindow.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+RESOURCES += \
+    ntrip.qrc