added correction data for gnss
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file rtcmInsert.cpp
|
||||
* @author * @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2022-03-24
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#include "rtcmInsert.h"
|
||||
|
||||
|
||||
RtcmInsert::RtcmInsert(uint8_t address, char* ntripHost, uint16_t ntripPort, char* ntripMountPoint, char* ntripUser, char* ntripPassword)
|
||||
: address() {
|
||||
this->ntrip_c = new NTRIPClient();
|
||||
|
||||
std::cout << "Requesting SourceTable." << std::endl;
|
||||
if(this->ntrip_c->reqSrcTbl(ntripHost, ntripPort)) {
|
||||
char buffer[512];
|
||||
delay(5);
|
||||
while(this->ntrip_c->available()) {
|
||||
this->ntrip_c->readLine(buffer,sizeof(buffer));
|
||||
std::cout << buffer;
|
||||
}
|
||||
}
|
||||
else
|
||||
std::cout << "SourceTable request error" << std::endl;
|
||||
|
||||
std::cout << "Requesting SourceTable is OK." << std::endl;
|
||||
this->ntrip_c->stop(); //Need to call "stop" function for next request.
|
||||
|
||||
std::cout << "Requesting MountPoint's Raw data" << std::endl;
|
||||
if(!this->ntrip_c->reqRaw(ntripHost, ntripPort, ntripMountPoint, ntripUser, ntripPassword))
|
||||
std::cout << "Error Requesting MountPoint's Raw data" << std::endl;
|
||||
else
|
||||
std::cout << "Requesting MountPoint is OK" << std::endl;
|
||||
}
|
||||
|
||||
void RtcmInsert::loop() {
|
||||
if (this->ntrip_c->available()) {
|
||||
Wire.beginTransmission(this->address);
|
||||
while(this->ntrip_c->available()) {
|
||||
char ch = this->ntrip_c->read();
|
||||
Wire.write(ch);
|
||||
}
|
||||
Wire.endTransmission();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @file rtcmInsert.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2022-03-24
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef RTCM_INSERT_H
|
||||
#define RTCM_INSERT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "NTRIPClient.h"
|
||||
|
||||
class RtcmInsert {
|
||||
public:
|
||||
RtcmInsert(uint8_t address, char* ntripHost, uint16_t ntripPort, char* ntripMountPoint, char* ntripUser, char* ntripPassword);
|
||||
|
||||
void loop();
|
||||
|
||||
private:
|
||||
uint8_t address;
|
||||
|
||||
NTRIPClient* ntrip_c;
|
||||
};
|
||||
|
||||
#endif // RTCM_INSERT_H
|
||||
Reference in New Issue
Block a user