diff --git a/src/GPS/GPSProvider.cc b/src/GPS/GPSProvider.cc index 44121945a014a1d06e3163f7683e96fde44f0295..a991ad689e1c4a64eceb612872d52739dd1003a8 100644 --- a/src/GPS/GPSProvider.cc +++ b/src/GPS/GPSProvider.cc @@ -18,9 +18,25 @@ #include "Drivers/src/gps_helper.h" #include "definitions.h" +//#define SIMULATE_RTCM_OUTPUT //if defined, generate simulated RTCM messages + //additionally make sure to call connectGPS(""), eg. from QGCToolbox.cc + void GPSProvider::run() { +#ifdef SIMULATE_RTCM_OUTPUT + const int fakeMsgLengths[3] = { 30, 170, 240 }; + uint8_t* fakeData = new uint8_t[fakeMsgLengths[2]]; + while (!_requestStop) { + for (int i = 0; i < 3; ++i) { + gotRTCMData((uint8_t*) fakeData, fakeMsgLengths[i]); + msleep(4); + } + msleep(100); + } + delete[] fakeData; +#endif /* SIMULATE_RTCM_OUTPUT */ + if (_serial) delete _serial; _serial = new QSerialPort();