private void RELEASE_DATA(byte[] bytes, bool save = true) { // Reset packet index packetIndex = 0; // Save data try { // Send signal to Interface? if (STATUS == SYS_STREAM_START) { double[] z = new double[16]; // Perform calibration var calibrated = NeuralNetCalib.CalibratePacket(bytes); // Place calibrated z axis data in array and send with event for (int i = 0; i < 16; i++) { z[i] = calibrated[i, Z_AXIS]; } PressureUpdatedEventArgs args = new PressureUpdatedEventArgs { Values = z }; PressureUpdated(this, args); } // Save to array of input data if (save) { DATA_IN.Add(bytes); } } catch (Exception ex) { Debug.WriteLine($"Failed to write {BitConverter.ToString(bytes)} to app with exception: {ex.Message}"); } // Return empty array of same size buffer = new byte[bytes.Length]; }