fix(*): isp version use type+version tostring().
This commit is contained in:
@@ -116,7 +116,7 @@ std::size_t DeviceInfoParser::GetFromData(
|
||||
info->isp_version.set_minor(data[i + 1]);
|
||||
i += 2;
|
||||
// firmware_version, 2
|
||||
info->firmware_version.set_major(data[i]);
|
||||
info->firmware_version.set_major(data[i + 1] ? data[i] : 0);
|
||||
info->firmware_version.set_minor(data[i + 1]);
|
||||
i += 2;
|
||||
// hardware_version, 3
|
||||
@@ -158,8 +158,8 @@ std::size_t DeviceInfoParser::GetFromData(
|
||||
info->auxiliary_chip_version.set_minor(data[i + 1]);
|
||||
i += 2;
|
||||
// isp_version, 2
|
||||
info->isp_version.set_major(data[i]);
|
||||
info->isp_version.set_minor(data[i + 1]);
|
||||
info->isp_version.set_major(0);
|
||||
info->isp_version.set_minor(data[i]);
|
||||
i += 2;
|
||||
} else {
|
||||
info->auxiliary_chip_version.set_major(0);
|
||||
|
||||
@@ -59,4 +59,21 @@ Type::value_t Type::parse_part(
|
||||
return std::stoi(name.substr(pos, count), 0, 16);
|
||||
}
|
||||
|
||||
std::string ISPVersion::to_string() const {
|
||||
std::stringstream s;
|
||||
if (major() == 0x01) {
|
||||
s << "S2000-";
|
||||
} else if (major() == 0x02) {
|
||||
s << "S2110-";
|
||||
} else if (major() == 0x03) {
|
||||
s << "S210A-";
|
||||
} else if (major() == 0x04) {
|
||||
s << "S2X0C-";
|
||||
} else if (major() == 0x05) {
|
||||
s << "S200B-";
|
||||
}
|
||||
s << static_cast<int>(minor());
|
||||
return s.str();
|
||||
}
|
||||
|
||||
MYNTEYE_END_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user