diff --git a/mission/tmtc/TmStore.cpp b/mission/tmtc/TmStore.cpp index 8429491c..331348ab 100644 --- a/mission/tmtc/TmStore.cpp +++ b/mission/tmtc/TmStore.cpp @@ -4,6 +4,7 @@ #include #include +#include using namespace returnvalue; @@ -66,8 +67,17 @@ ReturnValue_t TmStore::storePacket(PusTmReader& reader) { if (file.is_directory()) { continue; } - auto path = file.path(); + auto pathStr = file.path().string(); + Clock::TimeOfDay_t tod; + if(pathStr.find(baseName) == std::string::npos) { + continue; + } + float seconds = 0.0; + char* prefix = nullptr; // TODO: Scan file timestamp from name somehow. Maybe use scanf or similar? + int count = sscanf(pathStr.c_str(), "%s%4" SCNu32 "-%2" SCNu32 "-%2" + SCNu32 "T%2" SCNu32 ":%2" SCNu32 ":%fZ", prefix, &tod.year, &tod.month, &tod.day, + &tod.hour, &tod.minute, &seconds); } } // TODO: Need to find the file of the most recent file. diff --git a/tmtc b/tmtc index 96e27e71..a55572db 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 96e27e716349bf01cac11c7e7b0b497a36149e87 +Subproject commit a55572db2890ef9e8276c95ba8ebfb2d74a88f7c