test_class.file: app/src/test/java/org/hwyl/sexytopo/comms/MeasurementProtocolTest.java
test_class.identifier: MeasurementProtocolTest
test_case.body: @Test
      public void testDownMeasurementGetsParsedCorrectly() {
          byte[] packet = new byte[]{1, 84, 3, 113, -87, -83, -54, -13};
          Assert.assertTrue(MeasurementProtocol.isDataPacket(packet));
          Leg actual = MeasurementProtocol.parseDataPacket(packet);
          Leg expected = new Leg(0.852, 238.3, -75.0);
          assertLegEquality(expected, actual);
      }
test_case.class_method_signature: MeasurementProtocolTest.testDownMeasurementGetsParsedCorrectly()
test_case.full_signature: @Test public void testDownMeasurementGetsParsedCorrectly()
test_case.identifier: testDownMeasurementGetsParsedCorrectly
test_case.invocations: assertTrue isDataPacket parseDataPacket assertLegEquality
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDownMeasurementGetsParsedCorrectly()
focal_class.declarator: DISTANCE_LOW_BYTE = 1
focal_class.modifier: private static final
focal_class.original_string: private static final int DISTANCE_LOW_BYTE = 1;
focal_class.type: int
focal_class.var_name: DISTANCE_LOW_BYTE
focal_class.declarator: DISTANCE_HIGH_BYTE = 2
focal_class.modifier: private static final
focal_class.original_string: private static final int DISTANCE_HIGH_BYTE = 2;
focal_class.type: int
focal_class.var_name: DISTANCE_HIGH_BYTE
focal_class.declarator: AZIMUTH_LOW_BYTE = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int AZIMUTH_LOW_BYTE = 3;
focal_class.type: int
focal_class.var_name: AZIMUTH_LOW_BYTE
focal_class.declarator: AZIMUTH_HIGH_BYTE = 4
focal_class.modifier: private static final
focal_class.original_string: private static final int AZIMUTH_HIGH_BYTE = 4;
focal_class.type: int
focal_class.var_name: AZIMUTH_HIGH_BYTE
focal_class.declarator: INCLINATION_LOW_BYTE = 5
focal_class.modifier: private static final
focal_class.original_string: private static final int INCLINATION_LOW_BYTE = 5;
focal_class.type: int
focal_class.var_name: INCLINATION_LOW_BYTE
focal_class.declarator: INCLINATION_HIGH_BYTE = 6
focal_class.modifier: private static final
focal_class.original_string: private static final int INCLINATION_HIGH_BYTE = 6;
focal_class.type: int
focal_class.var_name: INCLINATION_HIGH_BYTE
focal_class.declarator: ROLL_ANGLE_HIGH_BYTE = 7
focal_class.modifier: private static final
focal_class.original_string: private static final int ROLL_ANGLE_HIGH_BYTE = 7;
focal_class.type: int
focal_class.var_name: ROLL_ANGLE_HIGH_BYTE
focal_class.declarator: DISTANCE_BIT_MASK = 0b01000000
focal_class.modifier: public static final
focal_class.original_string: public static final int DISTANCE_BIT_MASK = 0b01000000;
focal_class.type: int
focal_class.var_name: DISTANCE_BIT_MASK
focal_class.declarator: previousPacket = new byte[]{}
focal_class.modifier: protected
focal_class.original_string: protected byte[] previousPacket = new byte[]{};
focal_class.type: byte[]
focal_class.var_name: previousPacket
focal_class.declarator: duplicateCount = 0
focal_class.modifier: protected
focal_class.original_string: protected int duplicateCount = 0;
focal_class.type: int
focal_class.var_name: duplicateCount
focal_class.file: app/src/main/java/org/hwyl/sexytopo/comms/MeasurementProtocol.java
focal_class.identifier: MeasurementProtocol
focal_class.class_method_signature: MeasurementProtocol.MeasurementProtocol(
              SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager)
focal_class.full_signature: public  MeasurementProtocol(
              SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager)
focal_class.identifier: MeasurementProtocol
focal_class.modifiers: public
focal_class.parameters: (
              SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager)
focal_class.signature:  MeasurementProtocol(
              SexyTopoActivity activity, BluetoothDevice bluetoothDevice, SurveyManager dataManager)
focal_class.class_method_signature: MeasurementProtocol.parseDataPacket(byte[] packet)
focal_class.full_signature: public static Leg parseDataPacket(byte[] packet)
focal_class.identifier: parseDataPacket
focal_class.modifiers: public static
focal_class.parameters: (byte[] packet)
focal_class.return: Leg
focal_class.signature: Leg parseDataPacket(byte[] packet)
focal_class.class_method_signature: MeasurementProtocol.go(DataInputStream inStream, DataOutputStream outStream)
focal_class.full_signature: public void go(DataInputStream inStream, DataOutputStream outStream)
focal_class.identifier: go
focal_class.modifiers: public
focal_class.parameters: (DataInputStream inStream, DataOutputStream outStream)
focal_class.return: void
focal_class.signature: void go(DataInputStream inStream, DataOutputStream outStream)
focal_class.superclass: extends DistoXProtocol
focal_method.body: 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);
      }
focal_method.class_method_signature: MeasurementProtocol.parseDataPacket(byte[] packet)
focal_method.full_signature: public static Leg parseDataPacket(byte[] packet)
focal_method.identifier: parseDataPacket
focal_method.invocations: readByte readByte readDoubleByte readDoubleByte
focal_method.modifiers: public static
focal_method.parameters: (byte[] packet)
focal_method.return: Leg
focal_method.signature: Leg parseDataPacket(byte[] packet)