@Test public void testReadDoubleByteGy() { double result = CalibrationProtocol.readDoubleByte( TEST_ACCELERATION_PACKET, CalibrationProtocol.ACCELERATION_GY_LOW_BYTE, CalibrationProtocol.ACCELERATION_GY_HIGH_BYTE); Assert.assertEquals(-603, result, ALLOWED_DELTA); }
public static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex) { int low = packet[lowByteIndex] & 0xff; int high = packet[highByteIndex] & 0xff; int combined = (high * 256) + low; if (combined > 32768) combined -= 65536; return combined; }
CalibrationProtocol extends DistoXProtocol { public static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex) { int low = packet[lowByteIndex] & 0xff; int high = packet[highByteIndex] & 0xff; int combined = (high * 256) + low; if (combined > 32768) combined -= 65536; return combined; } }
CalibrationProtocol extends DistoXProtocol { public static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex) { int low = packet[lowByteIndex] & 0xff; int high = packet[highByteIndex] & 0xff; int combined = (high * 256) + low; if (combined > 32768) combined -= 65536; return combined; } CalibrationProtocol(
            SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager); }
CalibrationProtocol extends DistoXProtocol { public static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex) { int low = packet[lowByteIndex] & 0xff; int high = packet[highByteIndex] & 0xff; int combined = (high * 256) + low; if (combined > 32768) combined -= 65536; return combined; } CalibrationProtocol(
            SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager); @Override void go(DataInputStream inStream, DataOutputStream outStream); static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex); }
CalibrationProtocol extends DistoXProtocol { public static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex) { int low = packet[lowByteIndex] & 0xff; int high = packet[highByteIndex] & 0xff; int combined = (high * 256) + low; if (combined > 32768) combined -= 65536; return combined; } CalibrationProtocol(
            SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager); @Override void go(DataInputStream inStream, DataOutputStream outStream); static int readDoubleByte(byte[] packet, int lowByteIndex, int highByteIndex); static final int ACCELERATION_ADMIN; static final int ACCELERATION_GX_LOW_BYTE; static final int ACCELERATION_GX_HIGH_BYTE; static final int ACCELERATION_GY_LOW_BYTE; static final int ACCELERATION_GY_HIGH_BYTE; static final int ACCELERATION_GZ_LOW_BYTE; static final int ACCELERATION_GZ_HIGH_BYTE; static final int ACCELERATION_NOT_USED; static final int MAGNETIC_ADMIN; static final int MAGNETIC_MX_LOW_BYTE; static final int MAGNETIC_MX_HIGH_BYTE; static final int MAGNETIC_MY_LOW_BYTE; static final int MAGNETIC_MY_HIGH_BYTE; static final int MAGNETIC_MZ_LOW_BYTE; static final int MAGNETIC_MZ_HIGH_BYTE; static final int MAGNETIC_NOT_USED; }