new ntrip client
This commit is contained in:
+47
-8
@@ -3,16 +3,55 @@
|
||||
|
||||
#include <WiFiClient.h>
|
||||
#include <Arduino.h>
|
||||
#include<base64.h>
|
||||
#include <base64.h>
|
||||
#include <iostream>
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
|
||||
class NTRIPClient : public WiFiClient{
|
||||
public :
|
||||
bool reqSrcTbl(char* host,uint16_t port); //request MountPoints List serviced the NTRIP Caster
|
||||
bool reqRaw(char* host,uint16_t port,char* mntpnt,char* user,char* psw); //request RAW data from Caster
|
||||
bool reqRaw(char* host,uint16_t port,char* mntpnt); //non user
|
||||
int readLine(char* buffer,int size);
|
||||
enum NTRIPClientStates {
|
||||
openConnection,
|
||||
pushData,
|
||||
closeConnection,
|
||||
wait
|
||||
};
|
||||
class NTRIPClient {
|
||||
public:
|
||||
NTRIPClient(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, const char* mountPoint, const char* user, const char* password);
|
||||
~NTRIPClient();
|
||||
|
||||
|
||||
void loop();
|
||||
|
||||
void gpsConfiguration();
|
||||
void pushGPGGA(NMEA_GGA_data_t *nmeaData);
|
||||
|
||||
void setTransmitLocation(bool b) { this->transmitLocation = b; }
|
||||
void setActivated(bool b) { this->activated = b; }
|
||||
static void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct);
|
||||
|
||||
private:
|
||||
bool beginClient();
|
||||
void closeConnection();
|
||||
bool processConnection();
|
||||
|
||||
SFE_UBLOX_GNSS* gps;
|
||||
WiFiClient* ntripClient;
|
||||
NTRIPClientStates state;
|
||||
|
||||
bool transmitLocation = true;
|
||||
bool activated = true;
|
||||
|
||||
uint16_t port;
|
||||
uint32_t lastReceivedRtcmTime = 0;
|
||||
uint32_t lastNtripConnectTime = 0;
|
||||
uint32_t lastLoopTime = 0;
|
||||
|
||||
const char* host;
|
||||
const char* mountPoint;
|
||||
const char* user;
|
||||
const char* password;
|
||||
const uint8_t delayTime = 20;
|
||||
const uint16_t timeOut = 5000;
|
||||
const uint16_t tryReconnectTime = 5000;
|
||||
const uint16_t bufferSize = 512;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user