cleaning
refactore all components now have a base class compnent for loop functions
This commit is contained in:
@@ -22,19 +22,15 @@ NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS* gps, const char* host, uint16_t port, c
|
||||
|
||||
this->ntripClient = new WiFiClient;
|
||||
this->state = NTRIPClientStates::closeConnection;
|
||||
|
||||
this->loopDelay = 20;
|
||||
}
|
||||
|
||||
NTRIPClient::~NTRIPClient() {
|
||||
delete this->ntripClient;
|
||||
}
|
||||
|
||||
void NTRIPClient::loop() {
|
||||
this->pushGPGGA();
|
||||
|
||||
if (millis() - this->lastLoopTime < this->delayTime)
|
||||
return;
|
||||
this->lastLoopTime = millis();
|
||||
|
||||
void NTRIPClient::run() {
|
||||
switch (this->state) {
|
||||
case NTRIPClientStates::openConnection:
|
||||
if (!this->activated) {
|
||||
@@ -81,6 +77,10 @@ void NTRIPClient::loop() {
|
||||
}
|
||||
}
|
||||
|
||||
void NTRIPClient::runAsChild() {
|
||||
this->pushGPGGA();
|
||||
}
|
||||
|
||||
void NTRIPClient::gpsConfiguration() {
|
||||
this->gps->setSPIOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||
this->gps->setPortInput(COM_PORT_SPI, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);
|
||||
|
||||
Reference in New Issue
Block a user