diff --git a/bsp_q7s/memory/scratchApi.cpp b/bsp_q7s/memory/scratchApi.cpp index 83bc8239..1948ece3 100644 --- a/bsp_q7s/memory/scratchApi.cpp +++ b/bsp_q7s/memory/scratchApi.cpp @@ -1,8 +1,8 @@ #include "scratchApi.h" ReturnValue_t scratch::writeString(std::string name, std::string string) { - std::ostringstream oss; - oss << "xsc_scratch write " << name << " \"" << string << "\""; + std::ostringstream oss("xsc_scratch write ", std::ostringstream::ate); + oss << name << " \"" << string << "\""; int result = std::system(oss.str().c_str()); if (result != 0) { utility::handleSystemError(result, "scratch::writeString"); @@ -39,8 +39,8 @@ ReturnValue_t scratch::readString(std::string key, std::string &string) { } ReturnValue_t scratch::clearValue(std::string key) { - std::ostringstream oss; - oss << "xsc_scratch clear " << key; + std::ostringstream oss("xsc_scratch clear ", std::ostringstream::ate); + oss << key; int result = std::system(oss.str().c_str()); if (result != 0) { utility::handleSystemError(result, "scratch::clearValue"); diff --git a/bsp_q7s/memory/scratchApi.h b/bsp_q7s/memory/scratchApi.h index cd76fca1..b78fef7f 100644 --- a/bsp_q7s/memory/scratchApi.h +++ b/bsp_q7s/memory/scratchApi.h @@ -94,8 +94,8 @@ ReturnValue_t readToFile(std::string name, std::ifstream& file, std::string& fil template ::value>::type> inline ReturnValue_t writeNumber(std::string key, T num) noexcept { - std::ostringstream oss; - oss << "xsc_scratch write " << key << " " << std::to_string(num); + std::ostringstream oss("xsc_scratch write ", std::ostringstream::ate); + oss << key << " " << std::to_string(num); int result = std::system(oss.str().c_str()); if (result != 0) { utility::handleSystemError(result, "scratch::writeNumber"); diff --git a/mission/devices/ScexDeviceHandler.cpp b/mission/devices/ScexDeviceHandler.cpp index 4c84b40d..5cc11d7c 100644 --- a/mission/devices/ScexDeviceHandler.cpp +++ b/mission/devices/ScexDeviceHandler.cpp @@ -154,9 +154,10 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons ReturnValue_t status = RETURN_OK; auto oneFileHandler = [&](std::string cmdName) { fileId = random_string(6); - std::ostringstream oss("/tmp/scex-"); + std::ostringstream oss("/tmp/scex-", std::ostringstream::ate); oss << cmdName << fileId << ".bin"; fileName = oss.str(); + std::cout << fileName << std::endl; ofstream out(fileName, ofstream::binary); if (out.bad()) { sif::error << "ScexDeviceHandler::interpretDeviceReply: Could not open file " << fileName @@ -172,7 +173,7 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons if ((helper.getPacketCounter() == 1) or (not fileNameSet)) { fileId = random_string(6); - std::ostringstream oss("/tmp/scex-"); + std::ostringstream oss("/tmp/scex-", std::ostringstream::ate); oss << cmdName << fileId << ".bin"; fileName = oss.str(); fileNameSet = true; diff --git a/tmtc b/tmtc index 70435736..0a655f51 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 704357369e6374dc7cf8c88d71fd24bce3b772e0 +Subproject commit 0a655f51d4803d5561911101823e611d1f4a19ad