gps handler tweaks
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2021-08-11 18:52:33 +02:00
parent 0ae55e0783
commit 268cd33677
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 15 additions and 18 deletions

View File

@ -162,7 +162,7 @@ void ObjectFactory::produce(void* args){
uartCookie->setToFlushInput(true); uartCookie->setToFlushInput(true);
uartCookie->setReadCycles(6); uartCookie->setReadCycles(6);
GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER, GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER,
objects::UART_COM_IF, uartCookie); objects::UART_COM_IF, uartCookie, true);
gpsHandler->setStartUpImmediately(); gpsHandler->setStartUpImmediately();
#endif #endif

View File

@ -15,10 +15,7 @@
#define RPI_TEST_ACS_BOARD 0 #define RPI_TEST_ACS_BOARD 0
#endif #endif
#define RPI_ADD_UART_TEST 1 #define RPI_ADD_UART_TEST 0
#if RPI_ADD_UART_TEST == 1
#define RPI_TEST_GPS_DEVICE 0
#endif
/* Adapt these values accordingly */ /* Adapt these values accordingly */
namespace gpio { namespace gpio {

View File

@ -7,8 +7,9 @@
#include "lwgps/lwgps.h" #include "lwgps/lwgps.h"
GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF *comCookie): CookieIF *comCookie, bool debugHyperionGps):
DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this) { DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this),
debugHyperionGps(debugHyperionGps) {
lwgps_init(&gpsData); lwgps_init(&gpsData);
} }
@ -100,13 +101,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
gpsSet.hours = gpsData.hours; gpsSet.hours = gpsData.hours;
gpsSet.minutes = gpsData.minutes; gpsSet.minutes = gpsData.minutes;
gpsSet.seconds = gpsData.seconds; gpsSet.seconds = gpsData.seconds;
#if FSFW_HAL_DEBUG_HYPERION_GPS == 1 if(debugHyperionGps) {
sif::info << "GPS Data" << std::endl; sif::info << "GPS Data" << std::endl;
printf("Valid status: %d\n", gpsData.is_valid); printf("Valid status: %d\n", gpsData.is_valid);
printf("Latitude: %f degrees\n", gpsData.latitude); printf("Latitude: %f degrees\n", gpsData.latitude);
printf("Longitude: %f degrees\n", gpsData.longitude); printf("Longitude: %f degrees\n", gpsData.longitude);
printf("Altitude: %f meters\n", gpsData.altitude); printf("Altitude: %f meters\n", gpsData.altitude);
#endif }
} }
*foundLen = len; *foundLen = len;
} }

View File

@ -1,13 +1,11 @@
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#include "fsfw/FSFW.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "devicedefinitions/GPSDefinitions.h" #include "devicedefinitions/GPSDefinitions.h"
#include "lwgps/lwgps.h" #include "lwgps/lwgps.h"
#ifndef FSFW_HAL_DEBUG_HYPERION_GPS
#define FSFW_HAL_DEBUG_HYPERION_GPS 0
#endif
/** /**
* @brief Device handler for the Hyperion HT-GPS200 device * @brief Device handler for the Hyperion HT-GPS200 device
@ -18,7 +16,7 @@
class GPSHyperionHandler: public DeviceHandlerBase { class GPSHyperionHandler: public DeviceHandlerBase {
public: public:
GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF* comCookie); CookieIF* comCookie, bool debugHyperionGps = false);
virtual ~GPSHyperionHandler(); virtual ~GPSHyperionHandler();
protected: protected:
@ -54,6 +52,7 @@ protected:
private: private:
lwgps_t gpsData = {}; lwgps_t gpsData = {};
GpsPrimaryDataset gpsSet; GpsPrimaryDataset gpsSet;
bool debugHyperionGps = false;
}; };
#endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */ #endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */