How do iI read the content of "gpsPort" (Software Serial(9600)) for debugging, and still be able to provide everything to gnss.
My code:
#include <NMEAGPS.h>
#include <GPSport.h>
static NMEAGPS gnss;
static void handleGNSSdata( const gps_fix & fix );
loop() {
while (gnss.available( gpsPort ))
handleGNSSdata( gnss.read() );
}
psaudo code:
stream gpsPortCopy;
loop{
while(gpsPort.ready()){
stuff = gpsPort.read()
Serial.print(stuff);
gpsPortCopy.write(stuff )
handleGNSSdata( gpsPortCopy.read() );
}
}
This is basic c stuff, i know. But all answers I was able to pull out of Google was for c++ stl.
I want to be able to insert a line: Serial.print("stuff from GPS:" ); Serial.print(stuff);