Discovered the time valid timestamp in the boat location packet is quite inconsistent and either the stream or my implementation is making the display really buggy. Because the way it was before I changed things is more reliable at the moment, I have decided to wait until our mock stream is merged before continuing this development. #story[820]

This commit is contained in:
Peter Galloway
2017-05-01 16:56:53 +12:00
parent 99e50aa7ac
commit a5ca9218da
5 changed files with 63 additions and 28 deletions
@@ -78,9 +78,6 @@ public class StreamReceiver extends Thread {
long computedCrc = checksum.getValue();
long packetCrc = bytesToLong(getBytes(4));
if (computedCrc == packetCrc) {
// System.out.println("message type: " + type);
// System.out.println("timeStamp = " + timeStamp);
// System.out.println("payload length: " + payloadLength);
packetBuffer.add(new StreamPacket(type, payloadLength, timeStamp, payload));
} else {
System.err.println("Packet has been dropped");
@@ -126,7 +123,7 @@ public class StreamReceiver extends Thread {
* takes an array of up to 7 bytes and returns a positive
* long constructed from the input bytes
*
* @return a positive long if there is less than 7 bytes -1 otherwise
* @return a positive long if there is less than 8 bytes -1 otherwise
*/
private long bytesToLong(byte[] bytes){
long partialLong = 0;