ntripClient runs now - gnss to spi
This commit is contained in:
@@ -17,7 +17,19 @@ Navigation::Navigation(Route* route) {
|
||||
std::cout << "u-blox GNSS not detected at default I2C address. Please check wiring. Freezing." << std::endl;
|
||||
while (1);
|
||||
}
|
||||
this->init(route);
|
||||
}
|
||||
|
||||
Navigation::Navigation(SPIClass spiPort, uint8_t csPin, Route* route) {
|
||||
this->gps = new SFE_UBLOX_GNSS();
|
||||
if (this->gps->begin(spiPort, csPin, 4000000) == false) {
|
||||
std::cout << "u-blox GNSS not detected on SPI bus. Please check wiring. Freezing." << std::endl;
|
||||
while (1);
|
||||
}
|
||||
this->init(route);
|
||||
}
|
||||
|
||||
void Navigation::init(Route* route) {
|
||||
uint8_t versionHigh = this->gps->getProtocolVersionHigh();
|
||||
uint8_t versionLow = this->gps->getProtocolVersionLow();
|
||||
std::cout << "u-blox protocol version: " << unsigned(versionHigh) << "." << unsigned(versionLow) << std::endl;
|
||||
@@ -47,7 +59,7 @@ void Navigation::initNtrip(String host, uint16_t port, String mountPoint, String
|
||||
this->ntripClient = new NTRIPClient(this->gps, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
|
||||
this->ntripClient->gpsConfiguration();
|
||||
this->ntripClient->loop();
|
||||
this->ntripClient->setActivated(true);
|
||||
this->ntripClient->setActivated(false);
|
||||
this->isNtripInit = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user