Move supported firmware version to named variable

This commit is contained in:
BlackMark 2020-07-06 20:30:47 +02:00
parent b3d42de2f0
commit 8974306b15
2 changed files with 3 additions and 1 deletions

View File

@ -56,7 +56,7 @@ bool Sensor::isValidSensor()
}
const auto version = parseVersionResponse(response);
return version == "AdaptiveBrightness v1.2";
return version == SUPPORTED_FIRMWARE;
}
bool Sensor::getSensorCommandResponse(const QString& serialPortName, QByteArray command, QByteArray& response)

View File

@ -24,6 +24,8 @@ class Sensor {
static constexpr auto RANGE_CMD = std::string_view{"range"};
static constexpr auto READ_CMD = std::string_view{"read csv"};
static constexpr auto SUPPORTED_FIRMWARE = std::string_view{"AdaptiveBrightness v1.2"};
const QString m_serialPortName;
bool m_errorOccurred = false;