diff --git a/.github/workflows/run_unix.yml b/.github/workflows/run_unix.yml index 502264a9d..4b2cae663 100644 --- a/.github/workflows/run_unix.yml +++ b/.github/workflows/run_unix.yml @@ -156,17 +156,23 @@ jobs: - name: Synthetic C# Test run: | cd $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0 + cp $GITHUB_WORKSPACE/installed/lib/libBoardController.dylib $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0/ ./brainflow_get_data --board-id -1 env: DYLD_PRINT_LIBRARIES: 1 LD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib + DYLD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib - name: EEG Metrics C# Test run: | cd $GITHUB_WORKSPACE/csharp_package/brainflow/examples/eeg_metrics/bin/Release/net7.0 + cp $GITHUB_WORKSPACE/installed/lib/libBoardController.dylib $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0/ + cp $GITHUB_WORKSPACE/installed/lib/libDataHandler.dylib $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0/ + cp $GITHUB_WORKSPACE/installed/lib/libMLModule.dylib $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0/ ./eeg_metrics --board-id -1 env: DYLD_PRINT_LIBRARIES: 1 LD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib + DYLD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib - name: Run All Julia Tests run: | export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/installed/lib:$LD_LIBRARY_PATH diff --git a/csharp_package/brainflow/brainflow/board_controller_library.cs b/csharp_package/brainflow/brainflow/board_controller_library.cs index 2f7596b4f..ec7e10604 100644 --- a/csharp_package/brainflow/brainflow/board_controller_library.cs +++ b/csharp_package/brainflow/brainflow/board_controller_library.cs @@ -122,355 +122,180 @@ public enum BoardIds // so there is no really good solution public static class BoardControllerLibrary64 { - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int prepare_session (int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int start_stream (int buffer_size, string streamer_params, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int stop_stream (int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release_session (int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_current_board_data (int num_samples, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int[] returned_samples, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_data_count (int preset, int[] result, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_data (int data_count, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_level_board_controller (int log_level); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int log_message_board_controller (int log_level, string message); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int config_board (string config, byte[] response, int[] len, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_file_board_controller (string log_file); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_sampling_rate (int board_id, int preset, int[] sampling_rate); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_timestamp_channel (int board_id, int preset, int[] timestamp_channel); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_marker_channel (int board_id, int preset, int[] marker_channel); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_package_num_channel (int board_id, int preset, int[] package_num_channel); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_battery_channel (int board_id, int preset, int[] battery_channel); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_num_rows (int board_id, int preset, int[] num_rows); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eeg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_emg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_ecg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eda_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_ppg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_accel_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_rotation_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_analog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_gyro_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_other_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_temperature_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int is_prepared (int[] prepared, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eeg_names (int board_id, int preset, byte[] eeg_names, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_resistance_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_magnetometer_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_exg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_device_name (int board_id, int preset, byte[] name, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int insert_marker (double value, int preset, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_descr (int board_id, int preset, byte[] board_descr, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release_all_sessions (); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_version_board_controller (byte[] version, int[] len, int max_len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_presets (int board_id, int[] names, int[] len); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int add_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("BoardController.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int delete_streamer (string streamer, int preset, int board_id, string input_json); } public static class BoardControllerLibrary32 { - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int prepare_session (int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int start_stream (int buffer_size, string streamer_params, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int stop_stream (int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release_session (int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_current_board_data (int num_samples, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int[] returned_samples, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_data_count (int preset, int[] result, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_data (int data_count, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_level_board_controller (int log_level); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int log_message_board_controller (int log_level, string message); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int config_board (string config, byte[] response, int[] len, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_file_board_controller (string log_file); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_sampling_rate (int board_id, int preset, int[] sampling_rate); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_timestamp_channel (int board_id, int preset, int[] timestamp_channel); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_marker_channel (int board_id, int preset, int[] marker_channel); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_package_num_channel (int board_id, int preset, int[] package_num_channel); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_battery_channel (int board_id, int preset, int[] battery_channel); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_num_rows (int board_id, int preset, int[] num_rows); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eeg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_emg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_ecg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eda_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_ppg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_accel_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_rotation_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_analog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_gyro_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_other_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_temperature_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int is_prepared (int[] prepared, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_eeg_names (int board_id, int preset, byte[] eeg_names, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_resistance_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_exg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_device_name (int board_id, int preset, byte[] name, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int insert_marker (double value, int preset, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_descr (int board_id, int preset, byte[] board_descr, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release_all_sessions (); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_version_board_controller (byte[] version, int[] len, int max_len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_board_presets (int board_id, int[] names, int[] len); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int add_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int delete_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("BoardController32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("BoardController32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_magnetometer_channels (int board_id, int preset, int[] channels, int[] len); } - public static class BoardControllerLibraryLinux - { - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int prepare_session (int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int start_stream (int buffer_size, string streamer_params, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int stop_stream (int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release_session (int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_current_board_data (int num_samples, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int[] returned_samples, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_data_count (int preset, int[] result, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_data (int data_count, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_level_board_controller (int log_level); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int log_message_board_controller (int log_level, string message); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int config_board (string config, byte[] response, int[] len, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_file_board_controller (string log_file); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_sampling_rate (int board_id, int preset, int[] sampling_rate); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_timestamp_channel (int board_id, int preset, int[] timestamp_channel); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_marker_channel (int board_id, int preset, int[] marker_channel); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_package_num_channel (int board_id, int preset, int[] package_num_channel); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_battery_channel (int board_id, int preset, int[] battery_channel); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_num_rows (int board_id, int preset, int[] num_rows); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eeg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_emg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_ecg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eda_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_ppg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_accel_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_rotation_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_analog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_gyro_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_other_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_temperature_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int is_prepared (int[] prepared, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eeg_names (int board_id, int preset, byte[] eeg_names, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_resistance_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_exg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_device_name (int board_id, int preset, byte[] name, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int insert_marker (double value, int preset, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_descr (int board_id, int preset, byte[] board_descr, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release_all_sessions (); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_version_board_controller (byte[] version, int[] len, int max_len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_presets (int board_id, int[] names, int[] len); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int add_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int delete_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("BoardController.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_magnetometer_channels (int board_id, int preset, int[] channels, int[] len); - } - - public static class BoardControllerLibraryMac - { - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int prepare_session (int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int start_stream (int buffer_size, string streamer_params, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int insert_marker (double value, int preset, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int stop_stream (int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release_session (int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_current_board_data (int num_samples, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int[] returned_samples, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_data_count (int preset, int[] result, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_data (int data_count, int preset, [In, Out][MarshalAs (UnmanagedType.LPArray, ArraySubType = UnmanagedType.R8)] double[,] data_buf, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_level_board_controller (int log_level); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int log_message_board_controller (int log_level, string message); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int config_board (string config, byte[] response, int[] len, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_file_board_controller (string log_file); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_sampling_rate (int board_id, int preset, int[] sampling_rate); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_timestamp_channel (int board_id, int preset, int[] timestamp_channel); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_marker_channel (int board_id, int preset, int[] marker_channel); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_package_num_channel (int board_id, int preset, int[] package_num_channel); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_battery_channel (int board_id, int preset, int[] battery_channel); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_num_rows (int board_id, int preset, int[] num_rows); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eeg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_emg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_ecg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eda_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_ppg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_accel_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_rotation_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_analog_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_gyro_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_other_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_temperature_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int is_prepared (int[] prepared, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_eeg_names (int board_id, int preset, byte[] eeg_names, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_resistance_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_exg_channels (int board_id, int preset, int[] channels, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_device_name (int board_id, int preset, byte[] name, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_descr (int board_id, int preset, byte[] board_descr, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release_all_sessions (); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_version_board_controller (byte[] version, int[] len, int max_len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_board_presets (int board_id, int[] names, int[] len); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int add_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int delete_streamer (string streamer, int preset, int board_id, string input_json); - [DllImport ("libBoardController", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_magnetometer_channels (int board_id, int preset, int[] channels, int[] len); - } public static class BoardControllerLibrary { @@ -482,10 +307,6 @@ public static int prepare_session (int board_id, string input_json) return BoardControllerLibrary64.prepare_session (board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.prepare_session (board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.prepare_session (board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.prepare_session (board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -499,10 +320,6 @@ public static int start_stream (int buffer_size, string streamer_params, int boa return BoardControllerLibrary64.start_stream (buffer_size, streamer_params, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.start_stream (buffer_size, streamer_params, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.start_stream (buffer_size, streamer_params, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.start_stream (buffer_size, streamer_params, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -516,10 +333,6 @@ public static int stop_stream (int board_id, string input_json) return BoardControllerLibrary64.stop_stream (board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.stop_stream (board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.stop_stream (board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.stop_stream (board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -533,10 +346,6 @@ public static int release_session (int board_id, string input_json) return BoardControllerLibrary64.release_session (board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.release_session (board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.release_session (board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.release_session (board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -550,10 +359,6 @@ public static int get_current_board_data (int num_samples, int preset, [In, Out] return BoardControllerLibrary64.get_current_board_data (num_samples, preset, data_buf, returned_samples, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_current_board_data (num_samples, preset, data_buf, returned_samples, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_current_board_data (num_samples, preset, data_buf, returned_samples, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_current_board_data (num_samples, preset, data_buf, returned_samples, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -567,10 +372,6 @@ public static int get_board_data_count (int preset, int[] result, int board_id, return BoardControllerLibrary64.get_board_data_count (preset, result, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_board_data_count (preset, result, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_board_data_count (preset, result, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_board_data_count (preset, result, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -584,10 +385,6 @@ public static int is_prepared (int[] result, int board_id, string input_json) return BoardControllerLibrary64.is_prepared (result, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.is_prepared (result, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.is_prepared (result, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.is_prepared (result, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -601,10 +398,6 @@ public static int get_board_data (int data_count, int preset, [In, Out][MarshalA return BoardControllerLibrary64.get_board_data (data_count, preset, data_buf, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_board_data (data_count, preset, data_buf, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_board_data (data_count, preset, data_buf, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_board_data (data_count, preset, data_buf, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -618,10 +411,6 @@ public static int set_log_level_board_controller (int log_level) return BoardControllerLibrary64.set_log_level_board_controller (log_level); case LibraryEnvironment.x86: return BoardControllerLibrary32.set_log_level_board_controller (log_level); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.set_log_level_board_controller (log_level); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.set_log_level_board_controller (log_level); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -635,10 +424,6 @@ public static int log_message_board_controller (int log_level, string message) return BoardControllerLibrary64.log_message_board_controller (log_level, message); case LibraryEnvironment.x86: return BoardControllerLibrary32.log_message_board_controller (log_level, message); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.log_message_board_controller (log_level, message); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.log_message_board_controller (log_level, message); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -652,10 +437,6 @@ public static int insert_marker (double value, int preset, int board_id, string return BoardControllerLibrary64.insert_marker (value, preset, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.insert_marker (value, preset, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.insert_marker (value, preset, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.insert_marker (value, preset, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -670,10 +451,6 @@ public static int config_board (string config, byte[] str, int[] len, int board_ return BoardControllerLibrary64.config_board (config, str, len, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.config_board (config, str, len, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.config_board (config, str, len, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.config_board (config, str, len, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -687,10 +464,6 @@ public static int add_streamer (string streamer, int preset, int board_id, strin return BoardControllerLibrary64.add_streamer (streamer, preset, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.add_streamer (streamer, preset, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.add_streamer (streamer, preset, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.add_streamer (streamer, preset, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -704,10 +477,6 @@ public static int delete_streamer (string streamer, int preset, int board_id, st return BoardControllerLibrary64.delete_streamer (streamer, preset, board_id, input_json); case LibraryEnvironment.x86: return BoardControllerLibrary32.delete_streamer (streamer, preset, board_id, input_json); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.delete_streamer (streamer, preset, board_id, input_json); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.delete_streamer (streamer, preset, board_id, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -721,10 +490,6 @@ public static int set_log_file_board_controller (string log_file) return BoardControllerLibrary64.set_log_file_board_controller (log_file); case LibraryEnvironment.x86: return BoardControllerLibrary32.set_log_file_board_controller (log_file); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.set_log_file_board_controller (log_file); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.set_log_file_board_controller (log_file); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -738,10 +503,6 @@ public static int get_sampling_rate (int board_id, int preset, int[] sampling_ra return BoardControllerLibrary64.get_sampling_rate (board_id, preset, sampling_rate); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_sampling_rate (board_id, preset, sampling_rate); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_sampling_rate (board_id, preset, sampling_rate); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_sampling_rate (board_id, preset, sampling_rate); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -755,10 +516,6 @@ public static int get_package_num_channel (int board_id, int preset, int[] packa return BoardControllerLibrary64.get_package_num_channel (board_id, preset, package_num); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_package_num_channel (board_id, preset, package_num); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_package_num_channel (board_id, preset, package_num); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_package_num_channel (board_id, preset, package_num); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -772,10 +529,6 @@ public static int get_battery_channel (int board_id, int preset, int[] battery) return BoardControllerLibrary64.get_battery_channel (board_id, preset, battery); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_battery_channel (board_id, preset, battery); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_battery_channel (board_id, preset, battery); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_battery_channel (board_id, preset, battery); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -789,10 +542,6 @@ public static int get_num_rows (int board_id, int preset, int[] num_rows) return BoardControllerLibrary64.get_num_rows (board_id, preset, num_rows); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_num_rows (board_id, preset, num_rows); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_num_rows (board_id, preset, num_rows); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_num_rows (board_id, preset, num_rows); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -806,10 +555,6 @@ public static int get_timestamp_channel (int board_id, int preset, int[] timesta return BoardControllerLibrary64.get_timestamp_channel (board_id, preset, timestamp_channel); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_timestamp_channel (board_id, preset, timestamp_channel); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_timestamp_channel (board_id, preset, timestamp_channel); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_timestamp_channel (board_id, preset, timestamp_channel); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -823,10 +568,6 @@ public static int get_marker_channel (int board_id, int preset, int[] marker_cha return BoardControllerLibrary64.get_marker_channel (board_id, preset, marker_channel); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_marker_channel (board_id, preset, marker_channel); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_marker_channel (board_id, preset, marker_channel); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_marker_channel (board_id, preset, marker_channel); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -840,10 +581,6 @@ public static int get_eeg_names (int board_id, int preset, byte[] names, int[] l return BoardControllerLibrary64.get_eeg_names (board_id, preset, names, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_eeg_names (board_id, preset, names, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_eeg_names (board_id, preset, names, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_eeg_names (board_id, preset, names, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -857,10 +594,6 @@ public static int get_board_presets (int board_id, int[] names, int[] len) return BoardControllerLibrary64.get_board_presets (board_id, names, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_board_presets (board_id, names, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_board_presets (board_id, names, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_board_presets (board_id, names, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -874,10 +607,6 @@ public static int get_board_descr (int board_id, int preset, byte[] descr, int[] return BoardControllerLibrary64.get_board_descr (board_id, preset, descr, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_board_descr (board_id, preset, descr, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_board_descr (board_id, preset, descr, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_board_descr (board_id, preset, descr, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -891,10 +620,6 @@ public static int get_device_name (int board_id, int preset, byte[] name, int[] return BoardControllerLibrary64.get_device_name (board_id, preset, name, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_device_name (board_id, preset, name, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_device_name (board_id, preset, name, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_device_name (board_id, preset, name, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -908,10 +633,6 @@ public static int get_version_board_controller (byte[] version, int[] len, int m return BoardControllerLibrary64.get_version_board_controller (version, len, max_len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_version_board_controller (version, len, max_len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_version_board_controller (version, len, max_len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_version_board_controller (version, len, max_len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -925,10 +646,6 @@ public static int get_eeg_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_eeg_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_eeg_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_eeg_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_eeg_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -942,10 +659,6 @@ public static int get_exg_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_exg_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_exg_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_exg_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_exg_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -959,10 +672,6 @@ public static int get_emg_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_emg_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_emg_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_emg_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_emg_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -976,10 +685,6 @@ public static int get_ecg_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_ecg_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_ecg_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_ecg_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_ecg_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -993,10 +698,6 @@ public static int get_eog_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_eog_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_eog_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_eog_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_eog_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1010,10 +711,6 @@ public static int get_eda_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_eda_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_eda_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_eda_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_eda_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1027,10 +724,6 @@ public static int get_ppg_channels (int board_id, int preset, int[] channels, in return BoardControllerLibrary64.get_ppg_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_ppg_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_ppg_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_ppg_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1044,10 +737,6 @@ public static int get_accel_channels (int board_id, int preset, int[] channels, return BoardControllerLibrary64.get_accel_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_accel_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_accel_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_accel_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1061,10 +750,6 @@ public static int get_rotation_channels (int board_id, int preset, int[] channel return BoardControllerLibrary64.get_rotation_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_rotation_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_rotation_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_rotation_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1078,10 +763,6 @@ public static int get_analog_channels (int board_id, int preset, int[] channels, return BoardControllerLibrary64.get_analog_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_analog_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_analog_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_analog_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1095,10 +776,6 @@ public static int get_gyro_channels (int board_id, int preset, int[] channels, i return BoardControllerLibrary64.get_gyro_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_gyro_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_gyro_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_gyro_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1112,10 +789,6 @@ public static int get_other_channels (int board_id, int preset, int[] channels, return BoardControllerLibrary64.get_other_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_other_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_other_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_other_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1129,10 +802,6 @@ public static int get_temperature_channels (int board_id, int preset, int[] chan return BoardControllerLibrary64.get_temperature_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_temperature_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_temperature_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_temperature_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1146,10 +815,6 @@ public static int get_resistance_channels (int board_id, int preset, int[] chann return BoardControllerLibrary64.get_resistance_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_resistance_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_resistance_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_resistance_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1163,10 +828,6 @@ public static int get_magnetometer_channels (int board_id, int preset, int[] cha return BoardControllerLibrary64.get_magnetometer_channels (board_id, preset, channels, len); case LibraryEnvironment.x86: return BoardControllerLibrary32.get_magnetometer_channels (board_id, preset, channels, len); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.get_magnetometer_channels (board_id, preset, channels, len); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.get_magnetometer_channels (board_id, preset, channels, len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1180,10 +841,6 @@ public static int release_all_sessions () return BoardControllerLibrary64.release_all_sessions (); case LibraryEnvironment.x86: return BoardControllerLibrary32.release_all_sessions (); - case LibraryEnvironment.Linux: - return BoardControllerLibraryLinux.release_all_sessions (); - case LibraryEnvironment.MacOS: - return BoardControllerLibraryMac.release_all_sessions (); } return (int)BrainFlowExitCodes.GENERAL_ERROR; diff --git a/csharp_package/brainflow/brainflow/data_handler_library.cs b/csharp_package/brainflow/brainflow/data_handler_library.cs index 66066fd76..067e7ad73 100644 --- a/csharp_package/brainflow/brainflow/data_handler_library.cs +++ b/csharp_package/brainflow/brainflow/data_handler_library.cs @@ -117,445 +117,224 @@ public enum WaveletTypes class DataHandlerLibrary64 { - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_file_data_handler (string log_file); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int log_message_data_handler (int log_level, string message); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_level_data_handler (int log_level); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_lowpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_highpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_bandpass (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_bandstop (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_rolling_filter (double[] data, int len, int period, int operation); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_downsampling (double[] data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int write_file (double[] data, int num_rows, int num_cols, string file_name, string file_mode); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int read_file (double[] data, int[] num_rows, int[] num_cols, string file_name, int max_elements); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_num_elements_in_file (string file_name, int[] num_elements); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_wavelet_transform (double[] data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_inverse_wavelet_transform (double[] wavelet_coeffs, int original_data_len, int wavelet, int decomposition_level, int extension, int[] decomposition_lengths, double[] output_data); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_wavelet_denoising (double[] data, int data_len, int wavelet, int decomposition_level, int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_csp (double[] data, double[] labels, int n_epochs, int n_channels, int n_times, double[] output_filters, double[] output_eigenvalues); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_window (int window_function, int window_len, double[] window_data); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_fft (double[] data, int data_len, int window, double[] re, double[] im); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_ifft (double[] re, double[] im, int data_len, double[] data); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_nearest_power_of_two (int value, int[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_psd (double[] data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_band_power (double[] ampls, double[] freqs, int data_len, double freq_start, double freq_end, double[] res); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_psd_welch (double[] data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int detrend (double[] data, int len, int operation); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int remove_environmental_noise (double[] data, int len, int sampling_rate, int noise_type); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_custom_band_powers (double[] data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int calc_stddev (double[] data, int start_pos, int end_pos, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_railed_percentage (double[] data, int len, int gain, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_version_data_handler (byte[] version, int[] len, int max_len); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_oxygen_level (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, double coef1, double coef2, double coef3, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int restore_data_from_wavelet_detailed_coeffs (double[] data, int data_len, int wavelet, int decomposition_level, int level_to_restore, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int detect_peaks_z_score (double[] data, int data_len, int lag, double threshold, double influence, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_heart_rate (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, int fft_size, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_ica (double[] data, int rows, int cols, int num_components, double[] w, double[] k, double[] a, double[] s); // unsafe methods working with pointers - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_lowpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_highpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_bandpass (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_bandstop (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_rolling_filter (double* data, int len, int period, int operation); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_downsampling (double* data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_wavelet_transform (double* data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_wavelet_denoising (double* data, int data_len, int wavelet, int decomposition_level, int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_fft (double* data, int data_len, int window, double[] re, double[] im); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_psd (double* data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_psd_welch (double* data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detrend (double* data, int len, int operation); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int remove_environmental_noise (double* data, int len, int sampling_rate, int noise_type); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_custom_band_powers (double* data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int calc_stddev (double* data, int start_pos, int end_pos, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_railed_percentage (double* data, int len, int gain, double[] output); - [DllImport ("DataHandler.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detect_peaks_z_score (double* data, int data_len, int lag, double threshold, double influence, double[] output); } class DataHandlerLibrary32 { - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_file_data_handler (string log_file); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int log_message_data_handler (int log_level, string message); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_level_data_handler (int log_level); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_lowpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_highpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_bandpass (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_bandstop (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_rolling_filter (double[] data, int len, int period, int operation); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_downsampling (double[] data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int write_file (double[] data, int num_rows, int num_cols, string file_name, string file_mode); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int read_file (double[] data, int[] num_rows, int[] num_cols, string file_name, int max_elements); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_num_elements_in_file (string file_name, int[] num_elements); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_wavelet_transform (double[] data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_inverse_wavelet_transform (double[] wavelet_coeffs, int original_data_len, int wavelet, int decomposition_level, int extension, int[] decomposition_lengths, double[] output_data); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_wavelet_denoising (double[] data, int data_len, int wavelet, int decomposition_level, int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_csp (double[] data, double[] labels, int n_epochs, int n_channels, int n_times, double[] output_filters, double[] output_eigenvalues); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_window (int window_function, int window_len, double[] window_data); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_fft (double[] data, int data_len, int window, double[] re, double[] im); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_ifft (double[] re, double[] im, int data_len, double[] data); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_nearest_power_of_two (int value, int[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_psd (double[] data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_band_power (double[] ampls, double[] freqs, int data_len, double freq_start, double freq_end, double[] res); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_psd_welch (double[] data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int detrend (double[] data, int len, int operation); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_custom_band_powers (double[] data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int remove_environmental_noise (double[] data, int len, int sampling_rate, int noise_type); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int calc_stddev (double[] data, int start_pos, int end_pos, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_version_data_handler (byte[] version, int[] len, int max_len); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_railed_percentage (double[] data, int len, int gain, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_oxygen_level (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, double coef1, double coef2, double coef3, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int restore_data_from_wavelet_detailed_coeffs (double[] data, int data_len, int wavelet, int decomposition_level, int level_to_restore, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int detect_peaks_z_score (double[] data, int data_len, int lag, double threshold, double influence, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_heart_rate (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, int fft_size, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int perform_ica (double[] data, int rows, int cols, int num_components, double[] w, double[] k, double[] a, double[] s); // unsafe methods working with pointers - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_lowpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_highpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_bandpass (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_bandstop (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_rolling_filter (double* data, int len, int period, int operation); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_downsampling (double* data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_wavelet_transform (double* data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_wavelet_denoising (double* data, int data_len, int wavelet, int decomposition_level, int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int perform_fft (double* data, int data_len, int window, double[] re, double[] im); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_psd (double* data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_psd_welch (double* data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detrend (double* data, int len, int operation); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int remove_environmental_noise (double* data, int len, int sampling_rate, int noise_type); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_custom_band_powers (double* data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int calc_stddev (double* data, int start_pos, int end_pos, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int get_railed_percentage (double* data, int len, int gain, double[] output); - [DllImport ("DataHandler32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("DataHandler32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static unsafe extern int detect_peaks_z_score (double* data, int data_len, int lag, double threshold, double influence, double[] output); } - class DataHandlerLibraryLinux - { - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_file_data_handler (string log_file); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int log_message_data_handler (int log_level, string message); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_level_data_handler (int log_level); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_lowpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_highpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_bandpass (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_bandstop (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_rolling_filter (double[] data, int len, int period, int operation); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_downsampling (double[] data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int write_file (double[] data, int num_rows, int num_cols, string file_name, string file_mode); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int read_file (double[] data, int[] num_rows, int[] num_cols, string file_name, int max_elements); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_num_elements_in_file (string file_name, int[] num_elements); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_wavelet_transform (double[] data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_inverse_wavelet_transform (double[] wavelet_coeffs, int original_data_len, int wavelet, int decomposition_level, int extension, - int[] decomposition_lengths, double[] output_data); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_wavelet_denoising (double[] data, int data_len, int wavelet, int decomposition_level, - int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_csp (double[] data, double[] labels, int n_epochs, int n_channels, int n_times, double[] output_filters, double[] output_eigenvalues); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_window (int window_function, int window_len, double[] window_data); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_fft (double[] data, int data_len, int window, double[] re, double[] im); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_ifft (double[] re, double[] im, int data_len, double[] data); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_nearest_power_of_two (int value, int[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_psd (double[] data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_band_power (double[] ampls, double[] freqs, int data_len, double freq_start, double freq_end, double[] res); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_psd_welch (double[] data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int detrend (double[] data, int len, int operation); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_custom_band_powers (double[] data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int remove_environmental_noise (double[] data, int len, int sampling_rate, int noise_type); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int calc_stddev (double[] data, int start_pos, int end_pos, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_version_data_handler (byte[] version, int[] len, int max_len); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_railed_percentage (double[] data, int len, int gain, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_oxygen_level (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, double coef1, double coef2, double coef3, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int restore_data_from_wavelet_detailed_coeffs (double[] data, int data_len, int wavelet, int decomposition_level, int level_to_restore, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int detect_peaks_z_score (double[] data, int data_len, int lag, double threshold, double influence, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_heart_rate (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, int fft_size, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_ica (double[] data, int rows, int cols, int num_components, double[] w, double[] k, double[] a, double[] s); - // unsafe methods working with pointers - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_lowpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_highpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_bandpass (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_bandstop (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_rolling_filter (double* data, int len, int period, int operation); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_downsampling (double* data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_wavelet_transform (double* data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_wavelet_denoising (double* data, int data_len, int wavelet, int decomposition_level, - int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_fft (double* data, int data_len, int window, double[] re, double[] im); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_psd (double* data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_psd_welch (double* data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int detrend (double* data, int len, int operation); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int remove_environmental_noise (double* data, int len, int sampling_rate, int noise_type); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_custom_band_powers (double* data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int calc_stddev (double* data, int start_pos, int end_pos, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_railed_percentage (double* data, int len, int gain, double[] output); - [DllImport ("DataHandler.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int detect_peaks_z_score (double* data, int data_len, int lag, double threshold, double influence, double[] output); - } - - class DataHandlerLibraryMac - { - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_file_data_handler (string log_file); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int log_message_data_handler (int log_level, string message); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_level_data_handler (int log_level); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_lowpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_highpass (double[] data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_bandpass (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_bandstop (double[] data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_rolling_filter (double[] data, int len, int period, int operation); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_downsampling (double[] data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int write_file (double[] data, int num_rows, int num_cols, string file_name, string file_mode); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int read_file (double[] data, int[] num_rows, int[] num_cols, string file_name, int max_elements); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_num_elements_in_file (string file_name, int[] num_elements); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_wavelet_transform (double[] data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_inverse_wavelet_transform (double[] wavelet_coeffs, int original_data_len, int wavelet, int decomposition_level, int extension, - int[] decomposition_lengths, double[] output_data); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_wavelet_denoising (double[] data, int data_len, int wavelet, int decomposition_level, - int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_csp (double[] data, double[] labels, int n_epochs, int n_channels, int n_times, double[] output_filters, double[] output_eigenvalues); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_window (int window_function, int window_len, double[] window_data); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_fft (double[] data, int data_len, int window, double[] re, double[] im); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_ifft (double[] re, double[] im, int data_len, double[] data); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_nearest_power_of_two (int value, int[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_psd (double[] data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_band_power (double[] ampls, double[] freqs, int data_len, double freq_start, double freq_end, double[] res); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_psd_welch (double[] data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int detrend (double[] data, int len, int operation); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_custom_band_powers (double[] data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int remove_environmental_noise (double[] data, int len, int sampling_rate, int noise_type); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int calc_stddev (double[] data, int start_pos, int end_pos, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_version_data_handler (byte[] version, int[] len, int max_len); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_railed_percentage (double[] data, int len, int gain, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_oxygen_level (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, double coef1, double coef2, double coef3, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int restore_data_from_wavelet_detailed_coeffs (double[] data, int data_len, int wavelet, int decomposition_level, int level_to_restore, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int detect_peaks_z_score (double[] data, int data_len, int lag, double threshold, double influence, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_heart_rate (double[] ppg_ir, double[] ppg_red, int data_size, int sampling_rate, int fft_size, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int perform_ica (double[] data, int rows, int cols, int num_components, double[] w, double[] k, double[] a, double[] s); - // unsafe methods working with pointers - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_lowpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_highpass (double* data, int len, int sampling_rate, double cutoff, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_bandpass (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_bandstop (double* data, int len, int sampling_rate, double start_freq, double stop_freq, int order, int filter_type, double ripple); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_rolling_filter (double* data, int len, int period, int operation); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_downsampling (double* data, int len, int period, int operation, double[] downsampled_data); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_wavelet_transform (double* data, int data_len, int wavelet, int decomposition_level, int extension, double[] output_data, int[] decomposition_lengths); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_wavelet_denoising (double* data, int data_len, int wavelet, int decomposition_level, - int wavelet_denoising, int threshold, int extenstion_type, int noise_level); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int perform_fft (double* data, int data_len, int window, double[] re, double[] im); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_psd (double* data, int data_len, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_psd_welch (double* data, int data_len, int nfft, int overlap, int sampling_rate, int window, double[] ampls, double[] freqs); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int detrend (double* data, int len, int operation); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int remove_environmental_noise (double* data, int len, int sampling_rate, int noise_type); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_custom_band_powers (double* data, int rows, int cols, double[] start_freqs, double[] stop_freqs, int num_bands, int sampling_rate, int apply_filters, double[] avgs, double[] stddevs); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int calc_stddev (double* data, int start_pos, int end_pos, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int get_railed_percentage (double* data, int len, int gain, double[] output); - [DllImport ("libDataHandler.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern int detect_peaks_z_score (double* data, int data_len, int lag, double threshold, double influence, double[] output); - - } - class DataHandlerLibrary { public static int set_log_level_data_handler (int log_level) @@ -566,10 +345,6 @@ public static int set_log_level_data_handler (int log_level) return DataHandlerLibrary64.set_log_level_data_handler (log_level); case LibraryEnvironment.x86: return DataHandlerLibrary32.set_log_level_data_handler (log_level); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.set_log_level_data_handler (log_level); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.set_log_level_data_handler (log_level); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -583,10 +358,6 @@ public static int set_log_file_data_handler (string log_file) return DataHandlerLibrary64.set_log_file_data_handler (log_file); case LibraryEnvironment.x86: return DataHandlerLibrary32.set_log_file_data_handler (log_file); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.set_log_file_data_handler (log_file); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.set_log_file_data_handler (log_file); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -600,10 +371,6 @@ public static int remove_environmental_noise (double[] data, int len, int sampli return DataHandlerLibrary64.remove_environmental_noise (data, len, sampling_rate, noise_type); case LibraryEnvironment.x86: return DataHandlerLibrary32.remove_environmental_noise (data, len, sampling_rate, noise_type); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.remove_environmental_noise (data, len, sampling_rate, noise_type); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.remove_environmental_noise (data, len, sampling_rate, noise_type); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -617,10 +384,6 @@ public static int perform_ica (double[] data, int rows, int cols, int num_compon return DataHandlerLibrary64.perform_ica (data, rows, cols, num_components, w, k, a, s); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_ica (data, rows, cols, num_components, w, k, a, s); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_ica (data, rows, cols, num_components, w, k, a, s); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_ica (data, rows, cols, num_components, w, k, a, s); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -634,10 +397,6 @@ public static int perform_lowpass (double[] data, int len, int sampling_rate, do return DataHandlerLibrary64.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -651,10 +410,6 @@ public static int perform_highpass (double[] data, int len, int sampling_rate, d return DataHandlerLibrary64.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); } @@ -669,10 +424,6 @@ public static int perform_bandpass (double[] data, int len, int sampling_rate, d return DataHandlerLibrary64.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -686,10 +437,6 @@ public static int perform_bandstop (double[] data, int len, int sampling_rate, d return DataHandlerLibrary64.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -703,10 +450,6 @@ public static int perform_rolling_filter (double[] data, int len, int period, in return DataHandlerLibrary64.perform_rolling_filter (data, len, period, operation); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_rolling_filter (data, len, period, operation); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_rolling_filter (data, len, period, operation); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_rolling_filter (data, len, period, operation); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -720,10 +463,6 @@ public static int restore_data_from_wavelet_detailed_coeffs (double[] data, int return DataHandlerLibrary64.restore_data_from_wavelet_detailed_coeffs (data, len, wavelet, decomposition_level, level_to_restore, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.restore_data_from_wavelet_detailed_coeffs (data, len, wavelet, decomposition_level, level_to_restore, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.restore_data_from_wavelet_detailed_coeffs (data, len, wavelet, decomposition_level, level_to_restore, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.restore_data_from_wavelet_detailed_coeffs (data, len, wavelet, decomposition_level, level_to_restore, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -737,10 +476,6 @@ public static int detect_peaks_z_score (double[] data, int len, int lag, double return DataHandlerLibrary64.detect_peaks_z_score (data, len, lag, threshold, influence, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.detect_peaks_z_score (data, len, lag, threshold, influence, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.detect_peaks_z_score (data, len, lag, threshold, influence, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.detect_peaks_z_score (data, len, lag, threshold, influence, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -754,10 +489,6 @@ public static int detrend (double[] data, int len, int operation) return DataHandlerLibrary64.detrend (data, len, operation); case LibraryEnvironment.x86: return DataHandlerLibrary32.detrend (data, len, operation); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.detrend (data, len, operation); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.detrend (data, len, operation); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -771,10 +502,6 @@ public static int perform_downsampling (double[] data, int len, int period, int return DataHandlerLibrary64.perform_downsampling (data, len, period, operation, filtered_data); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_downsampling (data, len, period, operation, filtered_data); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_downsampling (data, len, period, operation, filtered_data); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_downsampling (data, len, period, operation, filtered_data); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -788,10 +515,6 @@ public static int read_file (double[] data, int[] num_rows, int[] num_cols, stri return DataHandlerLibrary64.read_file (data, num_rows, num_cols, file_name, max_elements); case LibraryEnvironment.x86: return DataHandlerLibrary32.read_file (data, num_rows, num_cols, file_name, max_elements); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.read_file (data, num_rows, num_cols, file_name, max_elements); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.read_file (data, num_rows, num_cols, file_name, max_elements); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -805,11 +528,6 @@ public static int write_file (double[] data, int num_rows, int num_cols, string return DataHandlerLibrary64.write_file (data, num_rows, num_cols, file_name, file_mode); case LibraryEnvironment.x86: return DataHandlerLibrary32.write_file (data, num_rows, num_cols, file_name, file_mode); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.write_file (data, num_rows, num_cols, file_name, file_mode); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.write_file (data, num_rows, num_cols, file_name, file_mode); - } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -823,10 +541,6 @@ public static int get_num_elements_in_file (string file_name, int[] num_elements return DataHandlerLibrary64.get_num_elements_in_file (file_name, num_elements); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_num_elements_in_file (file_name, num_elements); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_num_elements_in_file (file_name, num_elements); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_num_elements_in_file (file_name, num_elements); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -840,10 +554,6 @@ public static int get_nearest_power_of_two (int value, int[] output) return DataHandlerLibrary64.get_nearest_power_of_two (value, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_nearest_power_of_two (value, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_nearest_power_of_two (value, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_nearest_power_of_two (value, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -857,10 +567,6 @@ public static int perform_wavelet_transform (double[] data, int data_len, int wa return DataHandlerLibrary64.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -875,11 +581,7 @@ public static int perform_inverse_wavelet_transform (double[] wavelet_coeffs, in return DataHandlerLibrary64.perform_inverse_wavelet_transform (wavelet_coeffs, original_data_len, wavelet, decomposition_level, extension, decomposition_lengths, output_data); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_inverse_wavelet_transform (wavelet_coeffs, original_data_len, wavelet, decomposition_level, extension, decomposition_lengths, output_data); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_inverse_wavelet_transform (wavelet_coeffs, original_data_len, wavelet, decomposition_level, extension, decomposition_lengths, output_data); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_inverse_wavelet_transform (wavelet_coeffs, original_data_len, wavelet, decomposition_level, extension, decomposition_lengths, output_data); - } + } return (int)BrainFlowExitCodes.GENERAL_ERROR; } @@ -893,10 +595,6 @@ public static int perform_wavelet_denoising (double[] data, int data_len, int wa return DataHandlerLibrary64.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -910,10 +608,6 @@ public static int get_csp (double[] data, double[] labels, int n_epochs, int n_c return DataHandlerLibrary64.get_csp (data, labels, n_epochs, n_channels, n_times, output_filters, output_eigenvalues); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_csp (data, labels, n_epochs, n_channels, n_times, output_filters, output_eigenvalues); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_csp (data, labels, n_epochs, n_channels, n_times, output_filters, output_eigenvalues); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_csp (data, labels, n_epochs, n_channels, n_times, output_filters, output_eigenvalues); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -927,10 +621,6 @@ public static int get_window (int window_function, int window_len, double[] wind return DataHandlerLibrary64.get_window (window_function, window_len, window_data); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_window (window_function, window_len, window_data); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_window (window_function, window_len, window_data); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_window (window_function, window_len, window_data); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -944,10 +634,6 @@ public static int perform_fft (double[] data, int data_len, int window, double[] return DataHandlerLibrary64.perform_fft (data, data_len, window, output_re, output_im); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_fft (data, data_len, window, output_re, output_im); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_fft (data, data_len, window, output_re, output_im); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_fft (data, data_len, window, output_re, output_im); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -961,10 +647,6 @@ public static int get_custom_band_powers (double[] data, int rows, int cols, dou return DataHandlerLibrary64.get_custom_band_powers (data, rows, cols, start_freqs, stop_freqs, num_bands, sampling_rate, apply_filters, avgs, stddevs); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_custom_band_powers (data, rows, cols, start_freqs, stop_freqs, num_bands, sampling_rate, apply_filters, avgs, stddevs); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_custom_band_powers (data, rows, cols, start_freqs, stop_freqs, num_bands, sampling_rate, apply_filters, avgs, stddevs); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_custom_band_powers (data, rows, cols, start_freqs, stop_freqs, num_bands, sampling_rate, apply_filters, avgs, stddevs); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -978,10 +660,6 @@ public static int get_psd (double[] data, int data_len, int sampling_rate, int w return DataHandlerLibrary64.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -995,10 +673,6 @@ public static int get_band_power (double[] ampls, double[] freqs, int data_len, return DataHandlerLibrary64.get_band_power (ampls, freqs, data_len, start_freq, stop_freq, res); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_band_power (ampls, freqs, data_len, start_freq, stop_freq, res); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_band_power (ampls, freqs, data_len, start_freq, stop_freq, res); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_band_power (ampls, freqs, data_len, start_freq, stop_freq, res); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1012,10 +686,6 @@ public static int perform_ifft (double[] re, double[] im, int len, double[] data return DataHandlerLibrary64.perform_ifft (re, im, len, data); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_ifft (re, im, len, data); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_ifft (re, im, len, data); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_ifft (re, im, len, data); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1029,10 +699,6 @@ public static int get_psd_welch (double[] data, int data_len, int nfft, int over return DataHandlerLibrary64.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1046,10 +712,6 @@ public static int calc_stddev (double[] data, int start_pos, int end_pos, double return DataHandlerLibrary64.calc_stddev (data, start_pos, end_pos, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.calc_stddev (data, start_pos, end_pos, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.calc_stddev (data, start_pos, end_pos, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.calc_stddev (data, start_pos, end_pos, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1063,10 +725,6 @@ public static int get_railed_percentage (double[] data, int len, int gain, doubl return DataHandlerLibrary64.get_railed_percentage (data, len, gain, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_railed_percentage (data, len, gain, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_railed_percentage (data, len, gain, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_railed_percentage (data, len, gain, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1080,10 +738,6 @@ public static int get_oxygen_level (double[] ppg_ir, double[] ppg_red, int data_ return DataHandlerLibrary64.get_oxygen_level (ppg_ir, ppg_red, data_size, sampling_rate, coef1, coef2, coef3, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_oxygen_level (ppg_ir, ppg_red, data_size, sampling_rate, coef1, coef2, coef3, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_oxygen_level (ppg_ir, ppg_red, data_size, sampling_rate, coef1, coef2, coef3, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_oxygen_level (ppg_ir, ppg_red, data_size, sampling_rate, coef1, coef2, coef3, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1097,10 +751,6 @@ public static int get_heart_rate (double[] ppg_ir, double[] ppg_red, int data_si return DataHandlerLibrary64.get_heart_rate (ppg_ir, ppg_red, data_size, sampling_rate, fft_size, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_heart_rate (ppg_ir, ppg_red, data_size, sampling_rate, fft_size, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_heart_rate (ppg_ir, ppg_red, data_size, sampling_rate, fft_size, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_heart_rate (ppg_ir, ppg_red, data_size, sampling_rate, fft_size, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1114,10 +764,6 @@ public static int get_version_data_handler (byte[] version, int[] len, int max_l return DataHandlerLibrary64.get_version_data_handler (version, len, max_len); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_version_data_handler (version, len, max_len); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_version_data_handler (version, len, max_len); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_version_data_handler (version, len, max_len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1131,10 +777,6 @@ public static int log_message_data_handler (int log_level, string message) return DataHandlerLibrary64.log_message_data_handler (log_level, message); case LibraryEnvironment.x86: return DataHandlerLibrary32.log_message_data_handler (log_level, message); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.log_message_data_handler (log_level, message); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.log_message_data_handler (log_level, message); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1148,10 +790,6 @@ public static unsafe int remove_environmental_noise (double* data, int len, int return DataHandlerLibrary64.remove_environmental_noise (data, len, sampling_rate, noise_type); case LibraryEnvironment.x86: return DataHandlerLibrary32.remove_environmental_noise (data, len, sampling_rate, noise_type); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.remove_environmental_noise (data, len, sampling_rate, noise_type); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.remove_environmental_noise (data, len, sampling_rate, noise_type); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1165,10 +803,6 @@ public static unsafe int perform_lowpass (double* data, int len, int sampling_ra return DataHandlerLibrary64.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_lowpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1182,10 +816,6 @@ public static unsafe int perform_highpass (double* data, int len, int sampling_r return DataHandlerLibrary64.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_highpass (data, len, sampling_rate, cutoff, order, filter_type, ripple); } @@ -1200,10 +830,6 @@ public static unsafe int perform_bandpass (double* data, int len, int sampling_r return DataHandlerLibrary64.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_bandpass (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1217,10 +843,6 @@ public static unsafe int perform_bandstop (double* data, int len, int sampling_r return DataHandlerLibrary64.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_bandstop (data, len, sampling_rate, start_freq, stop_freq, order, filter_type, ripple); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1234,10 +856,6 @@ public static unsafe int perform_rolling_filter (double* data, int len, int peri return DataHandlerLibrary64.perform_rolling_filter (data, len, period, operation); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_rolling_filter (data, len, period, operation); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_rolling_filter (data, len, period, operation); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_rolling_filter (data, len, period, operation); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1251,10 +869,6 @@ public static unsafe int detect_peaks_z_score (double* data, int len, int lag, d return DataHandlerLibrary64.detect_peaks_z_score (data, len, lag, threshold, influence, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.detect_peaks_z_score (data, len, lag, threshold, influence, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.detect_peaks_z_score (data, len, lag, threshold, influence, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.detect_peaks_z_score (data, len, lag, threshold, influence, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1268,10 +882,6 @@ public static unsafe int detrend (double* data, int len, int operation) return DataHandlerLibrary64.detrend (data, len, operation); case LibraryEnvironment.x86: return DataHandlerLibrary32.detrend (data, len, operation); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.detrend (data, len, operation); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.detrend (data, len, operation); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1285,10 +895,6 @@ public static unsafe int perform_downsampling (double* data, int len, int period return DataHandlerLibrary64.perform_downsampling (data, len, period, operation, filtered_data); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_downsampling (data, len, period, operation, filtered_data); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_downsampling (data, len, period, operation, filtered_data); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_downsampling (data, len, period, operation, filtered_data); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1302,10 +908,6 @@ public static unsafe int perform_wavelet_transform (double* data, int data_len, return DataHandlerLibrary64.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_wavelet_transform (data, data_len, wavelet, decomposition_level, extension, output_data, decomposition_lengths); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1320,10 +922,6 @@ public static unsafe int perform_wavelet_denoising (double* data, int data_len, return DataHandlerLibrary64.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_wavelet_denoising (data, data_len, wavelet, decomposition_level, wavelet_denoising, threshold, extenstion_type, noise_level); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1337,10 +935,6 @@ public static unsafe int perform_fft (double* data, int data_len, int window, do return DataHandlerLibrary64.perform_fft (data, data_len, window, output_re, output_im); case LibraryEnvironment.x86: return DataHandlerLibrary32.perform_fft (data, data_len, window, output_re, output_im); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.perform_fft (data, data_len, window, output_re, output_im); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.perform_fft (data, data_len, window, output_re, output_im); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1354,10 +948,6 @@ public static unsafe int get_psd (double* data, int data_len, int sampling_rate, return DataHandlerLibrary64.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_psd (data, data_len, sampling_rate, window, output_ampls, output_freqs); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1371,10 +961,6 @@ public static unsafe int get_psd_welch (double* data, int data_len, int nfft, in return DataHandlerLibrary64.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_psd_welch (data, data_len, nfft, overlap, sampling_rate, window, output_ampls, output_freqs); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1388,10 +974,6 @@ public static unsafe int calc_stddev (double* data, int start_pos, int end_pos, return DataHandlerLibrary64.calc_stddev (data, start_pos, end_pos, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.calc_stddev (data, start_pos, end_pos, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.calc_stddev (data, start_pos, end_pos, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.calc_stddev (data, start_pos, end_pos, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -1405,10 +987,6 @@ public static unsafe int get_railed_percentage (double* data, int len, int gain, return DataHandlerLibrary64.get_railed_percentage (data, len, gain, output); case LibraryEnvironment.x86: return DataHandlerLibrary32.get_railed_percentage (data, len, gain, output); - case LibraryEnvironment.Linux: - return DataHandlerLibraryLinux.get_railed_percentage (data, len, gain, output); - case LibraryEnvironment.MacOS: - return DataHandlerLibraryMac.get_railed_percentage (data, len, gain, output); } return (int)BrainFlowExitCodes.GENERAL_ERROR; diff --git a/csharp_package/brainflow/brainflow/ml_module_library.cs b/csharp_package/brainflow/brainflow/ml_module_library.cs index f8d5dd95d..cb6de268c 100644 --- a/csharp_package/brainflow/brainflow/ml_module_library.cs +++ b/csharp_package/brainflow/brainflow/ml_module_library.cs @@ -24,85 +24,44 @@ public enum BrainFlowClassifiers public static class MLModuleLibrary64 { - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_file_ml_module (string log_file); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int log_message_ml_module (int log_level, string message); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_level_ml_module (int log_level); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int prepare (string input_json); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release (string input_json); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int predict (double[] data, int data_len, double[] output, int[] output_len, string input_json); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release_all (); - [DllImport ("MLModule.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_version_ml_module (byte[] version, int[] len, int max_len); } public static class MLModuleLibrary32 { - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_file_ml_module (string log_file); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int log_message_ml_module (int log_level, string message); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int set_log_level_ml_module (int log_level); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int prepare (string input_json); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release (string input_json); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int predict (double[] data, int data_len, double[] output, int[] output_len, string input_json); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int release_all (); - [DllImport ("MLModule32.dll", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] + [DllImport ("MLModule32", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern int get_version_ml_module (byte[] version, int[] len, int max_len); } - public static class MLModuleLibraryLinux - { - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_file_ml_module (string log_file); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int log_message_ml_module (int log_level, string message); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_level_ml_module (int log_level); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int prepare (string input_json); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release (string input_json); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int predict (double[] data, int data_len, double[] output, int[] output_len, string input_json); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release_all (); - [DllImport ("MLModule.so", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_version_ml_module (byte[] version, int[] len, int max_len); - } - - public static class MLModuleLibraryMac - { - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_file_ml_module (string log_file); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int log_message_ml_module (int log_level, string message); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int set_log_level_ml_module (int log_level); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int prepare (string input_json); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release (string input_json); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int predict (double[] data, int data_len, double[] output, int[] output_len, string input_json); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int release_all (); - [DllImport ("libMLModule.dylib", SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int get_version_ml_module (byte[] version, int[] len, int max_len); - } - - public static class MLModuleLibrary { public static int set_log_level_ml_module (int log_level) @@ -113,10 +72,6 @@ public static int set_log_level_ml_module (int log_level) return MLModuleLibrary64.set_log_level_ml_module (log_level); case LibraryEnvironment.x86: return MLModuleLibrary32.set_log_level_ml_module (log_level); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.set_log_level_ml_module (log_level); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.set_log_level_ml_module (log_level); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -130,10 +85,6 @@ public static int set_log_file_ml_module (string log_file) return MLModuleLibrary64.set_log_file_ml_module (log_file); case LibraryEnvironment.x86: return MLModuleLibrary32.set_log_file_ml_module (log_file); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.set_log_file_ml_module (log_file); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.set_log_file_ml_module (log_file); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -147,10 +98,6 @@ public static int prepare (string input_json) return MLModuleLibrary64.prepare (input_json); case LibraryEnvironment.x86: return MLModuleLibrary32.prepare (input_json); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.prepare (input_json); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.prepare (input_json); } @@ -165,10 +112,6 @@ public static int release (string input_json) return MLModuleLibrary64.release (input_json); case LibraryEnvironment.x86: return MLModuleLibrary32.release (input_json); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.release (input_json); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.release (input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -182,10 +125,6 @@ public static int predict (double[] data, int data_len, double[] output, int[] o return MLModuleLibrary64.predict (data, data_len, output, output_len, input_json); case LibraryEnvironment.x86: return MLModuleLibrary32.predict (data, data_len, output, output_len, input_json); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.predict (data, data_len, output, output_len, input_json); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.predict (data, data_len, output, output_len, input_json); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -199,10 +138,6 @@ public static int release_all () return MLModuleLibrary64.release_all (); case LibraryEnvironment.x86: return MLModuleLibrary32.release_all (); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.release_all (); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.release_all (); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -216,10 +151,6 @@ public static int get_version_ml_module (byte[] version, int[] len, int max_len) return MLModuleLibrary64.get_version_ml_module (version, len, max_len); case LibraryEnvironment.x86: return MLModuleLibrary32.get_version_ml_module (version, len, max_len); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.get_version_ml_module (version, len, max_len); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.get_version_ml_module (version, len, max_len); } return (int)BrainFlowExitCodes.GENERAL_ERROR; @@ -233,10 +164,6 @@ public static int log_message_ml_module (int log_level, string message) return MLModuleLibrary64.log_message_ml_module (log_level, message); case LibraryEnvironment.x86: return MLModuleLibrary32.log_message_ml_module (log_level, message); - case LibraryEnvironment.Linux: - return MLModuleLibraryLinux.log_message_ml_module (log_level, message); - case LibraryEnvironment.MacOS: - return MLModuleLibraryMac.log_message_ml_module (log_level, message); } return (int)BrainFlowExitCodes.GENERAL_ERROR; diff --git a/csharp_package/brainflow/brainflow/platform_helper.cs b/csharp_package/brainflow/brainflow/platform_helper.cs index 10a264c7d..7787bd938 100644 --- a/csharp_package/brainflow/brainflow/platform_helper.cs +++ b/csharp_package/brainflow/brainflow/platform_helper.cs @@ -18,15 +18,16 @@ public static LibraryEnvironment get_library_environment () { if (library_env == LibraryEnvironment.Unknown) { + // for linux and macos for now we dont add 32 to lib names even for 32 bits if (RuntimeInformation.IsOSPlatform (OSPlatform.Linux)) { Console.Error.Write ("Linux platform detected"); - library_env = LibraryEnvironment.Linux; + library_env = LibraryEnvironment.x64; } if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX)) { Console.Error.Write ("OSX platform detected"); - library_env = LibraryEnvironment.MacOS; + library_env = LibraryEnvironment.x64; } if (RuntimeInformation.IsOSPlatform (OSPlatform.Windows)) {