added virtual destuctor for menu things

This commit is contained in:
2022-10-03 17:02:34 +02:00
parent a1a976be57
commit ee5bc9129a
9 changed files with 46 additions and 58 deletions
+16 -4
View File
@@ -34,6 +34,13 @@ void NTRIPClient::loop() {
this->gps->checkUblox();
this->gps->checkCallbacks();
if (millis() - this->lastGPGGAPushTime > this->pushGPGGATime) {
NMEA_GGA_data_t *data = nullptr;
uint8_t res = this->gps->getLatestNMEAGPGGA(data);
if (res == 2)
this->pushGPGGA(data);
}
switch (this->state) {
case NTRIPClientStates::openConnection:
if (millis() - this->lastNtripConnectTime > this->tryReconnectTime)
@@ -72,12 +79,11 @@ void NTRIPClient::loop() {
void NTRIPClient::gpsConfiguration() {
this->gps->setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA);
this->gps->setPortInput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);
this->gps->(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible
this->gps->setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible
this->gps->setNavigationFrequency(1);
this->gps->setMainTalkerID(SFE_UBLOX_MAIN_TALKER_ID_GP);
this->gps->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_I2C, 10);
this->gps->setNMEAGPGGAcallbackPtr(&pushGPGGA); // Set up the callback for GPGGA
this->gps->setAutoPVTcallbackPtr(&(NTRIPClient::printPVTdata));
}
@@ -140,7 +146,7 @@ bool NTRIPClient::beginClient() {
this->ntripClient->stop();
return false;
}
delay(10)
delay(10);
}
//Check reply
@@ -214,7 +220,7 @@ bool NTRIPClient::processConnection() {
void NTRIPClient::pushGPGGA(NMEA_GGA_data_t *nmeaData) {
if (this->ntripClient->connected() && this->transmitLocation) {
std::cout << "Pushing GGA to server: " << (const char *)nmeaData->nmea) << std::endl;
std::cout << "Pushing GGA to server: " << (const char *)nmeaData->nmea << std::endl;
this->ntripClient->print((const char *)nmeaData->nmea);
}
}
@@ -262,3 +268,9 @@ void NTRIPClient::printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) {
<< "Carrier Solution: " << carrSolnString
<< "Horizontal Accuracy Estimate: " << hAcc << " mm" << std::endl;
}
bool NTRIPClient::isConnected() {
if (this->state == NTRIPClientStates::pushData)
return true;
return false;
}