Brief description of class still missing. More...
#include <GpsLink.h>
Signals | |
void | rawFileError () |
void | rawFileReady () |
void | rawFileSize (int size) |
Public Member Functions | |
void | abortRaw () |
GpsLink (Station *station) | |
void | highRateRefresh () |
void | navigation () |
void | raw () |
void | start () |
void | stop () |
Protected Member Functions | |
virtual int | bytesAvailable (const char *buffer, int bytesCount) |
virtual void | connected () |
Brief description of class still missing.
Full description of class still missing
GpsLink::GpsLink | ( | Station * | station | ) |
Description of constructor still missing
References DaemonLink::setPort(), and TRACE.
: DaemonLink(station) { TRACE; setPort(2974); _refresh.setInterval(2000); QObject::connect(&_refresh, SIGNAL(timeout()), this, SLOT(refreshVariableParameters())); _refresh.start(); _rawMode=false; }
void GpsLink::abortRaw | ( | ) |
References TRACE.
Referenced by Station::abortDownloadGps().
{ TRACE; _rawFile.close(); _rawFile.setFileName(QString::null); }
int GpsLink::bytesAvailable | ( | const char * | buffer, |
int | bytesCount | ||
) | [protected, virtual] |
Implements DaemonLink.
References bytesAvailable(), DaemonLink::match(), and TRACE.
Referenced by bytesAvailable().
{ TRACE; if(_rawMode) { return saveRaw(buffer, bytesCount); } int bytesRead=0; while(bytesRead<bytesCount) { // Scan for a line int newBytesRead; for(newBytesRead=bytesRead; newBytesRead<bytesCount && buffer[newBytesRead]!='\n'; newBytesRead++) {} if(newBytesRead==bytesCount) { return bytesRead; // partial line } switch(buffer[bytesRead]) { case 's': if(match(buffer, bytesRead, bytesCount, "state=")) { state(buffer, bytesRead, newBytesRead); } break; case 'r': if(match(buffer, bytesRead, bytesCount, "raw begin")) { _rawMode=true; newBytesRead++; return newBytesRead+saveRaw(buffer+newBytesRead, bytesCount-newBytesRead); } break; default: break; } bytesRead=newBytesRead+1; // Skip blanks and additionnal end of line characters while(bytesRead<bytesCount && isspace(buffer[bytesRead])) {bytesRead++;} } return bytesRead; }
void GpsLink::connected | ( | ) | [protected, virtual] |
Reimplemented from DaemonLink.
References TRACE.
{ TRACE; DaemonLink::connected(); refreshVariableParameters(); }
void GpsLink::highRateRefresh | ( | ) |
{
_refresh.setInterval(2000); // 2 s during startup
}
void GpsLink::navigation | ( | ) |
References DaemonLink::send(), and TRACE.
Referenced by Station::navigationGps().
void GpsLink::raw | ( | ) |
References QGpCoreTools::endl(), fileName, Station::gpsFileName(), QGpCoreTools::FletcherChecksum::reset(), DaemonLink::send(), DaemonLink::station(), QGpCoreTools::tr(), and TRACE.
Referenced by Station::downloadGps().
void GpsLink::rawFileError | ( | ) | [signal] |
void GpsLink::rawFileReady | ( | ) | [signal] |
void GpsLink::rawFileSize | ( | int | size | ) | [signal] |
void GpsLink::start | ( | ) |
References DaemonLink::send(), and TRACE.
Referenced by Station::startGps().
void GpsLink::stop | ( | ) |
References DaemonLink::send(), and TRACE.
Referenced by Station::stopGps().