more testing and bugfixes
This commit is contained in:
@ -39,7 +39,8 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
|
||||
if(doMountSdCard) {
|
||||
if(not blocking) {
|
||||
sif::warning << "SdCardManager::switchOnSdCard: Two-step command but manager is"
|
||||
" not configured for blocking operation. Forcing blocking mode.." << std::endl;
|
||||
" not configured for blocking operation. "
|
||||
"Forcing blocking mode.." << std::endl;
|
||||
blocking = true;
|
||||
}
|
||||
}
|
||||
@ -161,7 +162,7 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) {
|
||||
}
|
||||
ostringstream command;
|
||||
command << "q7hw sd set " << sdstring << " " << statestring;
|
||||
cmdExecutor.load(command.str(), blocking, true);
|
||||
cmdExecutor.load(command.str(), blocking, printCmdOutput);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if(blocking and result != HasReturnvaluesIF::RETURN_OK) {
|
||||
utility::handleSystemError(cmdExecutor.getLastError(), "SdCardManager::setSdCardState");
|
||||
@ -220,7 +221,7 @@ ReturnValue_t SdCardManager::mountSdCard(sd::SdCard sdCard) {
|
||||
currentOp = Operations::MOUNTING;
|
||||
}
|
||||
string sdMountCommand = "mount " + mountDev + " " + mountPoint;
|
||||
cmdExecutor.load(sdMountCommand, blocking, true);
|
||||
cmdExecutor.load(sdMountCommand, blocking, printCmdOutput);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if(blocking and result != HasReturnvaluesIF::RETURN_OK) {
|
||||
utility::handleSystemError(cmdExecutor.getLastError(), "SdCardManager::mountSdCard");
|
||||
@ -259,7 +260,7 @@ ReturnValue_t SdCardManager::unmountSdCard(sd::SdCard sdCard) {
|
||||
if(not blocking) {
|
||||
currentOp = Operations::UNMOUNTING;
|
||||
}
|
||||
cmdExecutor.load(sdUnmountCommand, blocking, true);
|
||||
cmdExecutor.load(sdUnmountCommand, blocking, printCmdOutput);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if(blocking and result != HasReturnvaluesIF::RETURN_OK) {
|
||||
utility::handleSystemError(cmdExecutor.getLastError(), "SdCardManager::unmountSdCard");
|
||||
@ -380,7 +381,7 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
|
||||
}
|
||||
// Use q7hw utility and pipe the command output into the state file
|
||||
std::string updateCmd = "q7hw sd info all > " + std::string(SD_STATE_FILE);
|
||||
cmdExecutor.load(updateCmd, blocking, true);
|
||||
cmdExecutor.load(updateCmd, blocking, printCmdOutput);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if(blocking and result != HasReturnvaluesIF::RETURN_OK) {
|
||||
utility::handleSystemError(cmdExecutor.getLastError(), "SdCardManager::mountSdCard");
|
||||
@ -450,3 +451,8 @@ void SdCardManager::setBlocking(bool blocking) {
|
||||
this->blocking = blocking;
|
||||
}
|
||||
|
||||
void SdCardManager::setPrintCommandOutput(bool print) {
|
||||
this->printCmdOutput = print;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user