class MeasurementProtocol extends DistoXProtocol {

    public static Leg parseDataPacket(byte[] packet) {

        int d0 = packet[ADMIN] & DISTANCE_BIT_MASK;
        int d1 = readByte(packet, DISTANCE_LOW_BYTE);
        int d2 = readByte(packet, DISTANCE_HIGH_BYTE);
        double distance = (d0 * 1024 + d2 * 256 + d1) / 1000.0;

        double azimuth_reading =
                readDoubleByte(packet, AZIMUTH_LOW_BYTE, AZIMUTH_HIGH_BYTE);
        double azimuth = azimuth_reading * 180.0 / 32768.0;

        double inclinationReading =
                readDoubleByte(packet, INCLINATION_LOW_BYTE, INCLINATION_HIGH_BYTE);
        double inclination = inclinationReading * 90.0 / 16384.0;
        if (inclinationReading >= 32768) {
            inclination = (65536 - inclinationReading) * -90.0 / 16384.0;
        }

        return new Leg(distance, azimuth, inclination);
    }

    public  MeasurementProtocol(
            SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager);

}