split up PSTs and add contd GPS handler

This commit is contained in:
2021-06-24 08:50:46 +02:00
parent cea1494649
commit 6ba3f6918d
6 changed files with 84 additions and 33 deletions

View File

@ -50,11 +50,25 @@ ReturnValue_t GPSHandler::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) {
// Pass data to GPS library
if(len > 0) {
sif::info << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl;
if (internalState == InternalStates::WAIT_FIRST_MESSAGE) {
// TODO: Check whether data is valid by chcking whether NMEA start string is valid
commandExecuted = true;
}
int result = lwgps_process(&gpsData, start, len);
if(result != 0) {
if(result != 1) {
sif::warning << "GPSHandler::scanForReply: Issue processing GPS data with lwgps"
<< std::endl;
}
else {
sif::info << "GPS Data" << std::endl;
// Print messages
printf("Valid status: %d\n", gpsData.is_valid);
printf("Latitude: %f degrees\n", gpsData.latitude);
printf("Longitude: %f degrees\n", gpsData.longitude);
printf("Altitude: %f meters\n", gpsData.altitude);
}
*foundLen = len;
}
return HasReturnvaluesIF::RETURN_OK;