[wpilib] Throw exception if the REV Pneumatic Hub firmware version is older than 22.0.0 (#3853)

This commit is contained in:
Noah Andrews
2022-01-03 13:09:30 -06:00
committed by GitHub
parent dae61226fa
commit c137569f91
4 changed files with 75 additions and 5 deletions

View File

@@ -27,6 +27,17 @@ public class PneumaticHub implements PneumaticsBase {
m_handle = REVPHJNI.initialize(module);
m_module = module;
m_handleMap.put(module, this);
final REVPHVersion version = REVPHJNI.getVersion(m_handle);
if (version.firmwareMajor > 0 && version.firmwareMajor < 22) {
final String fwVersion =
version.firmwareMajor + "." + version.firmwareMinor + "." + version.firmwareFix;
throw new IllegalStateException(
"The Pneumatic Hub has firmware version "
+ fwVersion
+ ", and must be updated to version 2022.0.0 or later "
+ "using the REV Hardware Client.");
}
}
@Override