ntrip, testMode, zed9 gnss modul

This commit is contained in:
2022-09-13 20:31:52 +02:00
parent c7cb0d3895
commit af6cb98898
43 changed files with 907 additions and 262 deletions
+33 -36
View File
@@ -1,37 +1,34 @@
#include"NTRIPClient.h"
bool NTRIPClient::reqSrcTbl(char* host,int &port)
{
if(!connect(host,port)){
Serial.print("Cannot connect to ");
Serial.println(host);
return false;
}/*p = String("GET ") + String("/") + String(" HTTP/1.0\r\n");
p = p + String("User-Agent: NTRIP Enbeded\r\n");*/
print(
"GET / HTTP/1.0\r\n"
"User-Agent: NTRIPClient for Arduino v1.0\r\n"
);
unsigned long timeout = millis();
while (available() == 0) {
if (millis() - timeout > 5000) {
Serial.println("Client Timeout !");
stop();
return false;
}
delay(10);
}
char buffer[50];
readLine(buffer,sizeof(buffer));
if(strncmp((char*)buffer,"SOURCETABLE 200 OK",17))
{
Serial.print((char*)buffer);
return false;
}
return true;
bool NTRIPClient::reqSrcTbl(char* host,uint16_t port){
if(!connect(host,port)){
Serial.print("Cannot connect to ");
Serial.println(host);
return false;
} /*p = String("GET ") + String("/") + String(" HTTP/1.0\r\n");
p = p + String("User-Agent: NTRIP Enbeded\r\n");*/
print(
"GET / HTTP/1.0\r\n"
"User-Agent: NTRIPClient for Arduino v1.0\r\n"
);
unsigned long timeout = millis();
while (available() == 0) {
if (millis() - timeout > 5000) {
Serial.println("Client Timeout !");
stop();
return false;
}
delay(10);
}
char buffer[50];
readLine(buffer,sizeof(buffer));
if(strncmp((char*)buffer,"SOURCETABLE 200 OK",17)) {
Serial.print((char*)buffer);
return false;
}
return true;
}
bool NTRIPClient::reqRaw(char* host,int &port,char* mntpnt,char* user,char* psw)
{
bool NTRIPClient::reqRaw(char* host,uint16_t port,char* mntpnt,char* user,char* psw) {
if(!connect(host,port))return false;
String p="GET /";
String auth="";
@@ -79,12 +76,12 @@ bool NTRIPClient::reqRaw(char* host,int &port,char* mntpnt,char* user,char* psw)
}
return true;
}
bool NTRIPClient::reqRaw(char* host,int &port,char* mntpnt)
{
bool NTRIPClient::reqRaw(char* host,uint16_t port,char* mntpnt) {
return reqRaw(host,port,mntpnt,"","");
}
int NTRIPClient::readLine(char* _buffer,int size)
{
int NTRIPClient::readLine(char* _buffer,int size) {
int len = 0;
while(available()) {
_buffer[len] = read();