Move default device parameters from DeviceFactory to the respective devices #1257 (#1259)

* Move default parameter handling
This commit is contained in:
Uwe Seimet
2023-10-30 11:24:18 +01:00
committed by GitHub
parent 2de0aa090a
commit c78ba80088
20 changed files with 103 additions and 124 deletions
+21 -14
View File
@@ -73,6 +73,27 @@ bool SCSIPrinter::Init(const param_map& params)
return true;
}
void SCSIPrinter::CleanUp()
{
PrimaryDevice::CleanUp();
if (out.is_open()) {
out.close();
error_code error;
remove(path(filename), error);
filename = "";
}
}
param_map SCSIPrinter::GetDefaultParams() const
{
return {
{ "cmd", "lp -oraw %f" }
};
}
void SCSIPrinter::TestUnitReady()
{
// The printer is always ready
@@ -164,17 +185,3 @@ bool SCSIPrinter::WriteByteSequence(span<const uint8_t> buf)
return !out.fail();
}
void SCSIPrinter::CleanUp()
{
PrimaryDevice::CleanUp();
if (out.is_open()) {
out.close();
error_code error;
remove(path(filename), error);
filename = "";
}
}