gps test worked
EIVE/eive-obsw/pipeline/head There was a failure building this commit Details

This commit is contained in:
Robin Müller 2022-01-15 13:05:11 +01:00
parent 2323fd0506
commit e73dc2f191
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 35 additions and 1 deletions

View File

@ -66,6 +66,7 @@ set(LIB_ARCSEC wire)
set(THIRD_PARTY_FOLDER thirdparty)
set(LIB_CXX_FS -lstdc++fs)
set(LIB_CATCH2 Catch2)
set(LIB_GPS gps)
set(LIB_JSON_NAME nlohmann_json::nlohmann_json)
# Set path names
@ -221,6 +222,7 @@ if((NOT BUILD_Q7S_SIMPLE_MODE) AND (NOT EIVE_BUILD_WATCHDOG))
if(TGT_BSP MATCHES "arm/q7s")
target_link_libraries(${TARGET_NAME} PRIVATE
${LIB_ARCSEC}
${LIB_GPS}
)
endif()
endif()

View File

@ -12,8 +12,12 @@
#include "test/DummyParameter.h"
#include <nlohmann/json.hpp>
#include <gps.h>
#include <libgpsmm.h>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdio>
@ -31,6 +35,11 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
return TestTask::performOneShotAction();
}
ReturnValue_t Q7STestTask::performPeriodicAction() {
testGpsDaemon();
return TestTask::performPeriodicAction();
}
void Q7STestTask::testSdCard() {
using namespace std;
Stopwatch stopwatch;
@ -224,6 +233,26 @@ void Q7STestTask::testProtHandler() {
}
}
void Q7STestTask::testGpsDaemon() {
gpsmm gpsmm(GPSD_SHARED_MEMORY, 0);
gps_data_t* gps;
gps = gpsmm.read();
if(gps == nullptr) {
sif::warning << "Q7STestTask: Reading GPS data failed" << std::endl;
}
sif::info << "-- Q7STestTask: GPS shared memory read test --" << std::endl;
time_t timeRaw = gps->fix.time.tv_sec;
std::tm* time = gmtime(&timeRaw);
sif::info << "Time: " << std::put_time(time, "%c %Z") << std::endl;
sif::info << "Visible satellites: " << gps->satellites_visible << std::endl;
sif::info << "Satellites used: " << gps->satellites_used << std::endl;
sif::info << "Fix (0:Not Seen|1:No Fix|2:2D|3:3D): " << gps->fix.mode << std::endl;
sif::info << "Latitude: " << gps->fix.latitude << std::endl;
sif::info << "Longitude: " << gps->fix.longitude << std::endl;
sif::info << "Altitude(MSL): " << gps->fix.altMSL << std::endl;
sif::info << "Speed(m/s): " << gps->fix.speed << std::endl;
}
void Q7STestTask::testFileSystemHandlerDirect(FsOpCodes opCode) {
auto fsHandler = ObjectManager::instance()->
get<FileSystemHandler>(objects::FILE_SYSTEM_HANDLER);

View File

@ -11,6 +11,9 @@ public:
private:
CoreController* coreController = nullptr;
ReturnValue_t performOneShotAction() override;
ReturnValue_t performPeriodicAction() override;
void testGpsDaemon();
void testSdCard();
void fileTests();

2
fsfw

@ -1 +1 @@
Subproject commit 5214f8a449d195ecfa69f978cc0fe001ef76130a
Subproject commit c1e0bcee6db652d6c474c87a4099e61ecf86b694