lwgps update

This commit is contained in:
Robin Müller 2021-02-28 16:16:22 +01:00 committed by Robin Mueller
parent b74e137212
commit 5b8ddd3abb
2 changed files with 45 additions and 43 deletions

View File

@ -12,35 +12,35 @@
TestTask::TestTask(object_id_t objectId_): TestTask::TestTask(object_id_t objectId_):
SystemObject(objectId_), testMode(testModes::A) { SystemObject(objectId_), testMode(testModes::A) {
IPCStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE); IPCStore = objectManager->get<StorageManagerIF>(objects::IPC_STORE);
} }
TestTask::~TestTask() { TestTask::~TestTask() {
} }
ReturnValue_t TestTask::performOperation(uint8_t operationCode) { ReturnValue_t TestTask::performOperation(uint8_t operationCode) {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
if(oneShotAction) { if(oneShotAction) {
/* Add code here which should only be run once */ /* Add code here which should only be run once */
performOneShotAction(); performOneShotAction();
oneShotAction = false; oneShotAction = false;
} }
/* Add code here which should only be run once per performOperation */ /* Add code here which should only be run once per performOperation */
performPeriodicAction(); performPeriodicAction();
/* Add code here which should only be run on alternating cycles. */ /* Add code here which should only be run on alternating cycles. */
if(testMode == testModes::A) { if(testMode == testModes::A) {
performActionA(); performActionA();
testMode = testModes::B; testMode = testModes::B;
} }
else if(testMode == testModes::B) { else if(testMode == testModes::B) {
performActionB(); performActionB();
testMode = testModes::A; testMode = testModes::A;
} }
return result; return result;
} }
#include <etl/vector.h> #include <etl/vector.h>
@ -51,20 +51,20 @@ ReturnValue_t TestTask::performOperation(uint8_t operationCode) {
*/ */
const char const char
gps_rx_data[] = "" gps_rx_data[] = ""
"$GPRMC,183729,A,3907.356,N,12102.482,W,000.0,360.0,080301,015.5,E*6F\r\n" "$GPRMC,183729,A,3907.356,N,12102.482,W,000.0,360.0,080301,015.5,E*6F\r\n"
"$GPRMB,A,,,,,,,,,,,,V*71\r\n" "$GPRMB,A,,,,,,,,,,,,V*71\r\n"
"$GPGGA,183730,3907.356,N,12102.482,W,1,05,1.6,646.4,M,-24.1,M,,*75\r\n" "$GPGGA,183730,3907.356,N,12102.482,W,1,05,1.6,646.4,M,-24.1,M,,*75\r\n"
"$GPGSA,A,3,02,,,07,,09,24,26,,,,,1.6,1.6,1.0*3D\r\n" "$GPGSA,A,3,02,,,07,,09,24,26,,,,,1.6,1.6,1.0*3D\r\n"
"$GPGSV,2,1,08,02,43,088,38,04,42,145,00,05,11,291,00,07,60,043,35*71\r\n" "$GPGSV,2,1,08,02,43,088,38,04,42,145,00,05,11,291,00,07,60,043,35*71\r\n"
"$GPGSV,2,2,08,08,02,145,00,09,46,303,47,24,16,178,32,26,18,231,43*77\r\n" "$GPGSV,2,2,08,08,02,145,00,09,46,303,47,24,16,178,32,26,18,231,43*77\r\n"
"$PGRME,22.0,M,52.9,M,51.0,M*14\r\n" "$PGRME,22.0,M,52.9,M,51.0,M*14\r\n"
"$GPGLL,3907.360,N,12102.481,W,183730,A*33\r\n" "$GPGLL,3907.360,N,12102.481,W,183730,A*33\r\n"
"$PGRMZ,2062,f,3*2D\r\n" "$PGRMZ,2062,f,3*2D\r\n"
"$PGRMM,WGS84*06\r\n" "$PGRMM,WGS84*06\r\n"
"$GPBOD,,T,,M,,*47\r\n" "$GPBOD,,T,,M,,*47\r\n"
"$GPRTE,1,1,c,0*07\r\n" "$GPRTE,1,1,c,0*07\r\n"
"$GPRMC,183731,A,3907.482,N,12102.436,W,000.0,360.0,080301,015.5,E*67\r\n" "$GPRMC,183731,A,3907.482,N,12102.436,W,000.0,360.0,080301,015.5,E*67\r\n"
"$GPRMB,A,,,,,,,,,,,,V*71\r\n"; "$GPRMB,A,,,,,,,,,,,,V*71\r\n";
ReturnValue_t TestTask::performOneShotAction() { ReturnValue_t TestTask::performOneShotAction() {
#if OBSW_ADD_TEST_CODE == 1 #if OBSW_ADD_TEST_CODE == 1
@ -75,20 +75,20 @@ ReturnValue_t TestTask::performOneShotAction() {
ReturnValue_t TestTask::performPeriodicAction() { ReturnValue_t TestTask::performPeriodicAction() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
return result; return result;
} }
ReturnValue_t TestTask::performActionA() { ReturnValue_t TestTask::performActionA() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
/* Add periodically executed code here */ /* Add periodically executed code here */
return result; return result;
} }
ReturnValue_t TestTask::performActionB() { ReturnValue_t TestTask::performActionB() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
/* Add periodically executed code here */ /* Add periodically executed code here */
return result; return result;
} }
void TestTask::performLwgpsTest() { void TestTask::performLwgpsTest() {
@ -96,6 +96,8 @@ void TestTask::performLwgpsTest() {
etl::vector<uint8_t, 30> testVec; etl::vector<uint8_t, 30> testVec;
lwgps_t gpsStruct; lwgps_t gpsStruct;
sif::info << "Size of GPS struct: " << sizeof(gpsStruct) << std::endl;
lwgps_init(&gpsStruct);
/* Process all input data */ /* Process all input data */
lwgps_process(&gpsStruct, gps_rx_data, strlen(gps_rx_data)); lwgps_process(&gpsStruct, gps_rx_data, strlen(gps_rx_data));

2
thirdparty/lwgps vendored

@ -1 +1 @@
Subproject commit 8c16e298ca03128a109d9ba159ccce1788836382 Subproject commit d276f9722d1311b552e7c99ee5b03a68487a0fc5