Fix backwards compatibility with old firmware and owoTrack

This commit is contained in:
Eiren Rain committed 2022-01-28 02:53:08 +02:00
1 parent 4f14f01830
commit d99cbb9c85
4 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ import io.eiren.util.logging.LogManager;
public class Main {
public static String VERSION = "0.1.4";
public static String VERSION = "0.1.4a";
public static VRServer vrServer;
@@ -130,7 +130,7 @@ public class TrackersUDPServer extends Thread {
LogManager.log.info("[TrackerServer] Tracker " + i + " added with address " + handshakePacket.getSocketAddress() + ". Board type: " + handshake.boardType + ", imu type: " + handshake.imuType + ", firmware: " + handshake.firmware + " (" + connection.firmwareBuild + "), mac: " + handshake.macString + ", name: " + connection.name);
}
}
if(connection.protocol == NetworkProtocol.OWO_LEGACY || connection.firmwareBuild < 8) {
if(connection.protocol == NetworkProtocol.OWO_LEGACY || connection.firmwareBuild < 9) {
// Set up new sensor for older firmware
// Firmware after 7 should send sensor status packet and sensor will be created when it's received
setUpSensor(connection, 0, handshake.imuType, 1);
@@ -23,7 +23,8 @@ public class UDPPacket15SensorInfo extends UDPPacket implements SensorSpecificPa
public void readData(ByteBuffer buf) throws IOException {
sensorId = buf.get() & 0xFF;
sensorStatus = buf.get() & 0xFF;
sensorType = buf.get() & 0xFF;
if(buf.remaining() > 0)
sensorType = buf.get() & 0xFF;
}
@Override
@@ -51,7 +51,7 @@ public class UDPProtocolParser {
if(newPacket != null) {
newPacket.readData(buf);
} else {
LogManager.log.debug("[UDPPorotocolParser] Skipped packet id " + packetId + " from " + connection);
//LogManager.log.debug("[UDPPorotocolParser] Skipped packet id " + packetId + " from " + connection);
}
return newPacket;
}