Permalink
Browse files

Versioning check now checks for success flag in the packet. Otherwise…

…, devices that echo input can be misidentified as speaking our language. Like old-school modems with echo on. *shudder*
  • Loading branch information...
1 parent 67d2928 commit 8274a002d0916bb26b779f909224f94f63cc0490 @phooky phooky committed with FarMcKon Feb 29, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/replicatorg/drivers/gen3/Sanguino3GDriver.java
@@ -514,7 +514,7 @@ public Version getVersionInternal() {
pb.add16(Base.VERSION);
PacketResponse pr = runQuery(pb.getPacket(), 1);
- if (pr.isEmpty())
+ if (pr.isEmpty() || !pr.isOK())
return null;
int versionNum = pr.get16();
@@ -523,7 +523,7 @@ public Version getVersionInternal() {
String buildname = "";
pr = runQuery(pb.getPacket(), 1);
- if (!pr.isEmpty()) {
+ if (!pr.isEmpty() && pr.isOK()) {
byte[] payload = pr.getPayload();
byte[] subarray = new byte[payload.length - 1];
System.arraycopy(payload, 1, subarray, 0, subarray.length);

0 comments on commit 8274a00

Please sign in to comment.