diff --git a/.editorconfig b/.editorconfig
index d3422af..826d0fe 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -4,10 +4,23 @@
###############################
# All files
[*]
+charset = utf8
+indent_style = space
indent_size = 4
insert_final_newline = true
-charset = utf
-indent_style = space
+trim_trailing_whitespace = true
+
+###############################
+# File Extension Settings #
+###############################
+
+# Visual Studio Solution Files
+[*.sln]
+indent_style = tab
+
+# Visual Studio XML Project Files
+[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
+indent_size = 2
[*.{cs,csx,vb,vbx}]
diff --git a/.github/workflows/dotnet-core.yaml b/.github/workflows/dotnet-core.yaml
deleted file mode 100644
index 8fc56b0..0000000
--- a/.github/workflows/dotnet-core.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: .NET Core
-
-on:
- push:
- branches: '*'
- pull_request:
- branches: [ master ]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Install .NET Core
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: 5.x
- - name: Build and package liblsl
- run: dotnet pack -c Release liblsl.csproj -o pkg
- - name: Build and package examples
- run: dotnet pack -c Release examples/LSLExamples.csproj -o pkg
-# - name: Run examples
-# run: dotnet run -p examples/LSLExamples.csproj
- - name: Upload build artifacts
- uses: actions/upload-artifact@v1
- with:
- name: nuget pkg
- path: pkg
diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml
new file mode 100644
index 0000000..265b2ad
--- /dev/null
+++ b/.github/workflows/dotnet.yaml
@@ -0,0 +1,88 @@
+name: LSL.Net
+
+on:
+ pull_request:
+ push:
+ branches: '*'
+ workflow_dispatch:
+ release:
+ types: [ published ]
+
+jobs:
+ build:
+ name: Build-${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ ubuntu-latest, windows-latest, macOS-latest ]
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install .NET SDK
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: |
+ 5.0.x
+ 6.0.x
+
+ - name: List installed .NET SDKs
+ run: dotnet --list-sdks
+
+ - name: Build
+ run: dotnet build -c Release LSL.Net.sln
+
+ - name: Pack
+ run: dotnet pack -c Release src/LSL.Net.slnf
+
+ - name: Setup library path
+ if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
+ run: |
+ echo ${{ github.workspace }}
+ uname -a
+ if [[ "$OSTYPE" == "darwin"* ]]; then
+ echo "DYLD_LIBRARY_PATH=${{ github.workspace }}/examples/LSLVer/bin/Release/net6.0" >> "$GITHUB_ENV"
+ else
+ echo "LD_LIBRARY_PATH=${{ github.workspace }}/examples/LSLVer/bin/Release/net6.0" >> "$GITHUB_ENV"
+ fi
+
+ - name: Run LSLVer
+ # LSL.Net.runtime for linux and macOS is not yet landed.
+ if: ${{ runner.os == 'Windows' }}
+ run: dotnet run -c Release -p examples/LSLVer/LSLVer.csproj -f net6.0
+
+ - name: Upload build artifacts
+ if: ${{ runner.os == 'Linux' }}
+ uses: actions/upload-artifact@v4
+ with:
+ name: nuget-packages
+ path: "**/*.*nupkg"
+
+ publish:
+ name: Publish
+ runs-on: ubuntu-latest
+ needs: build
+ if: github.event_name == 'release'
+ steps:
+ - name: Install .NET SDK
+ uses: actions/setup-dotnet@v4
+
+ - name: Download artifacts
+ uses: actions/download-artifact@v4
+ with:
+ name: nuget-packages
+
+ - name: Push NuGet packages
+ run: |
+ dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
+
+ - name: Release
+ uses: softprops/action-gh-release@v2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ generate_release_notes: true
+ files: |
+ **/*.nupkg
+ **/*.snupkg
diff --git a/Directory.Build.props b/Directory.Build.props
index 84e162b..8378018 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,8 +1,18 @@
+
+ net35;netstandard2.0;net5.0;net6.0
+ latest
+ true
+ true
+ true
+ false
+ true
+ 1.16.2-preview.1
+
+
Christian Kothe
- netstandard2.0
- 1.12.2
+ Christian Kothe
+ Copyright © Christian Kothe 2021-2025
-
diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 0000000..294f949
--- /dev/null
+++ b/Directory.Packages.props
@@ -0,0 +1,14 @@
+
+
+ true
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/liblsl.sln b/LSL.Net.sln
similarity index 63%
rename from liblsl.sln
rename to LSL.Net.sln
index 56fc09e..d6df6c9 100644
--- a/liblsl.sln
+++ b/LSL.Net.sln
@@ -1,10 +1,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29609.76
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35728.132
MinimumVisualStudioVersion = 15.0.26124.0
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "liblsl", "liblsl.csproj", "{9CF380F5-EB84-4A39-969E-7E6F5534F17F}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{2831BC99-EB85-43AC-AEDF-8A689B8268FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandleMetaData", "examples\HandleMetaData\HandleMetaData.csproj", "{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}"
@@ -21,6 +19,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SendDataInChunks", "example
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SendStringMarkers", "examples\SendStringMarkers\SendStringMarkers.csproj", "{0847C79E-E4BD-4B67-8DB7-6873415815A6}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E771A42F-A73C-4C1E-B50E-58CA0A6A2113}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LSL.Net", "src\LSL.Net\LSL.Net.csproj", "{AFD9C248-E42F-4C6E-829E-712096292FE7}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "runtimes", "runtimes", "{55693EBC-5165-42D3-A433-69A4503F8867}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LSL.Net.runtime.win-x64", "src\LSL.Net.runtime\win-x64\LSL.Net.runtime.win-x64.csproj", "{C310E070-EA3B-4E65-A00B-549B980F0881}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LSL.Net.runtime.win-x86", "src\LSL.Net.runtime\win-x86\LSL.Net.runtime.win-x86.csproj", "{A2D6D146-96BF-431C-AEF8-3C21CC60206A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LSLVer", "examples\LSLVer\LSLVer.csproj", "{96CF8C5B-D343-4ECF-AC40-1F87891F046B}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -31,24 +41,12 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Debug|x64.Build.0 = Debug|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Debug|x86.ActiveCfg = Debug|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Debug|x86.Build.0 = Debug|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Release|Any CPU.Build.0 = Release|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Release|x64.ActiveCfg = Release|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Release|x64.Build.0 = Release|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Release|x86.ActiveCfg = Release|Any CPU
- {9CF380F5-EB84-4A39-969E-7E6F5534F17F}.Release|x86.Build.0 = Release|Any CPU
{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x64.Build.0 = Debug|Any CPU
- {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x86.ActiveCfg = Debug|Any CPU
- {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x86.Build.0 = Debug|Any CPU
+ {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x64.ActiveCfg = Debug|x64
+ {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x64.Build.0 = Debug|x64
+ {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x86.ActiveCfg = Debug|x86
+ {55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Debug|x86.Build.0 = Debug|x86
{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Release|Any CPU.Build.0 = Release|Any CPU
{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Release|x64.ActiveCfg = Release|Any CPU
@@ -57,10 +55,10 @@ Global
{55625B73-07CD-4C9F-ABFB-FB3C5899A79F}.Release|x86.Build.0 = Release|Any CPU
{98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x64.Build.0 = Debug|Any CPU
- {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x86.Build.0 = Debug|Any CPU
+ {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x64.ActiveCfg = Debug|x64
+ {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x64.Build.0 = Debug|x64
+ {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x86.ActiveCfg = Debug|x86
+ {98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Debug|x86.Build.0 = Debug|x86
{98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Release|Any CPU.Build.0 = Release|Any CPU
{98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Release|x64.ActiveCfg = Release|Any CPU
@@ -69,10 +67,10 @@ Global
{98F76BEE-C774-44C0-BAF3-BFF4B429420B}.Release|x86.Build.0 = Release|Any CPU
{A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x64.Build.0 = Debug|Any CPU
- {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x86.Build.0 = Debug|Any CPU
+ {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x64.ActiveCfg = Debug|x64
+ {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x64.Build.0 = Debug|x64
+ {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x86.ActiveCfg = Debug|x86
+ {A0EF1C60-7461-415B-9C98-F28A3283258A}.Debug|x86.Build.0 = Debug|x86
{A0EF1C60-7461-415B-9C98-F28A3283258A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0EF1C60-7461-415B-9C98-F28A3283258A}.Release|Any CPU.Build.0 = Release|Any CPU
{A0EF1C60-7461-415B-9C98-F28A3283258A}.Release|x64.ActiveCfg = Release|Any CPU
@@ -81,10 +79,10 @@ Global
{A0EF1C60-7461-415B-9C98-F28A3283258A}.Release|x86.Build.0 = Release|Any CPU
{8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x64.ActiveCfg = Debug|Any CPU
- {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x64.Build.0 = Debug|Any CPU
- {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x86.Build.0 = Debug|Any CPU
+ {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x64.ActiveCfg = Debug|x64
+ {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x64.Build.0 = Debug|x64
+ {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x86.ActiveCfg = Debug|x86
+ {8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Debug|x86.Build.0 = Debug|x86
{8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Release|Any CPU.Build.0 = Release|Any CPU
{8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Release|x64.ActiveCfg = Release|Any CPU
@@ -93,10 +91,10 @@ Global
{8AB092B9-F671-4185-BB6C-543B6A2AE55A}.Release|x86.Build.0 = Release|Any CPU
{4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x64.Build.0 = Debug|Any CPU
- {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x86.ActiveCfg = Debug|Any CPU
- {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x86.Build.0 = Debug|Any CPU
+ {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x64.ActiveCfg = Debug|x64
+ {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x64.Build.0 = Debug|x64
+ {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x86.ActiveCfg = Debug|x86
+ {4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Debug|x86.Build.0 = Debug|x86
{4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Release|Any CPU.Build.0 = Release|Any CPU
{4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Release|x64.ActiveCfg = Release|Any CPU
@@ -105,10 +103,10 @@ Global
{4DB5312C-5B29-4725-8EA0-3458AC36FB08}.Release|x86.Build.0 = Release|Any CPU
{4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x64.Build.0 = Debug|Any CPU
- {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x86.Build.0 = Debug|Any CPU
+ {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x64.ActiveCfg = Debug|x64
+ {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x64.Build.0 = Debug|x64
+ {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x86.ActiveCfg = Debug|x86
+ {4763E2F5-B238-4896-AC52-217555ACFF2A}.Debug|x86.Build.0 = Debug|x86
{4763E2F5-B238-4896-AC52-217555ACFF2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4763E2F5-B238-4896-AC52-217555ACFF2A}.Release|Any CPU.Build.0 = Release|Any CPU
{4763E2F5-B238-4896-AC52-217555ACFF2A}.Release|x64.ActiveCfg = Release|Any CPU
@@ -117,16 +115,64 @@ Global
{4763E2F5-B238-4896-AC52-217555ACFF2A}.Release|x86.Build.0 = Release|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x64.ActiveCfg = Debug|Any CPU
- {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x64.Build.0 = Debug|Any CPU
- {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x86.Build.0 = Debug|Any CPU
+ {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x64.ActiveCfg = Debug|x64
+ {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x64.Build.0 = Debug|x64
+ {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x86.ActiveCfg = Debug|x86
+ {0847C79E-E4BD-4B67-8DB7-6873415815A6}.Debug|x86.Build.0 = Debug|x86
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Release|Any CPU.Build.0 = Release|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Release|x64.ActiveCfg = Release|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Release|x64.Build.0 = Release|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Release|x86.ActiveCfg = Release|Any CPU
{0847C79E-E4BD-4B67-8DB7-6873415815A6}.Release|x86.Build.0 = Release|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Debug|x64.Build.0 = Debug|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Debug|x86.Build.0 = Debug|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Release|x64.ActiveCfg = Release|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Release|x64.Build.0 = Release|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Release|x86.ActiveCfg = Release|Any CPU
+ {AFD9C248-E42F-4C6E-829E-712096292FE7}.Release|x86.Build.0 = Release|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Debug|x64.Build.0 = Debug|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Debug|x86.Build.0 = Debug|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Release|x64.ActiveCfg = Release|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Release|x64.Build.0 = Release|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Release|x86.ActiveCfg = Release|Any CPU
+ {C310E070-EA3B-4E65-A00B-549B980F0881}.Release|x86.Build.0 = Release|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Debug|x64.Build.0 = Debug|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Debug|x86.Build.0 = Debug|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Release|x64.ActiveCfg = Release|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Release|x64.Build.0 = Release|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Release|x86.ActiveCfg = Release|Any CPU
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A}.Release|x86.Build.0 = Release|Any CPU
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Debug|x64.ActiveCfg = Debug|x64
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Debug|x64.Build.0 = Debug|x64
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Debug|x86.ActiveCfg = Debug|x86
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Debug|x86.Build.0 = Debug|x86
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Release|x64.ActiveCfg = Release|x64
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Release|x64.Build.0 = Release|x64
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Release|x86.ActiveCfg = Release|x86
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -139,6 +185,11 @@ Global
{4DB5312C-5B29-4725-8EA0-3458AC36FB08} = {2831BC99-EB85-43AC-AEDF-8A689B8268FC}
{4763E2F5-B238-4896-AC52-217555ACFF2A} = {2831BC99-EB85-43AC-AEDF-8A689B8268FC}
{0847C79E-E4BD-4B67-8DB7-6873415815A6} = {2831BC99-EB85-43AC-AEDF-8A689B8268FC}
+ {AFD9C248-E42F-4C6E-829E-712096292FE7} = {E771A42F-A73C-4C1E-B50E-58CA0A6A2113}
+ {55693EBC-5165-42D3-A433-69A4503F8867} = {E771A42F-A73C-4C1E-B50E-58CA0A6A2113}
+ {C310E070-EA3B-4E65-A00B-549B980F0881} = {55693EBC-5165-42D3-A433-69A4503F8867}
+ {A2D6D146-96BF-431C-AEF8-3C21CC60206A} = {55693EBC-5165-42D3-A433-69A4503F8867}
+ {96CF8C5B-D343-4ECF-AC40-1F87891F046B} = {2831BC99-EB85-43AC-AEDF-8A689B8268FC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3C10DB2A-2433-4783-82DF-C6433CBD211B}
diff --git a/README.md b/README.md
index 6f67ec0..b7a131c 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,32 @@
-# C# bindings
+# LSL.Net
-The is the C# interface to the lab streaming layer. To use it, you need to include the file LSL.cs in your project, and make sure that the appropriate lsl library (e.g. lsl.dll) is findable (e.g., in your application's root directory or in a system path). If LSL.cs fails to find the lsl shared library for your target platform, edit LSL.cs and update the libname line with the library name for your target platform. As of liblsl 1.14, this should be the same for all targets: `const string libname = "lsl";`
+LSL.Net is a cross-platform C# binding of [Lab Streaming Layer](https://github.com/sccn/labstreaminglayer).
-## Using Visual Studio 2019
+## Usage
-* Make sure you have the .NET desktop development pack installed.
-* Open the liblsl.sln file. If you are asked to upgrade then go ahead.
-* Add lsl.dll to your solution.
- * In the solution explorer, right click on the `liblsl` target and choose `Add > Existing Item ...`.
- * In the new explorer window, change the `Add` dropdown button to `Add as Link` and change the file types/extensions to `all files (*.*)`. Browse to where you have lsl.dll ([previously downloaded from here](https://github.com/sccn/liblsl/releases)) and select it.
-* Click on the lsl.dll entry now in the solution explorer to view its properties.
-* Set "Build Action" to "Content" and "Copy to Output Directory" to "Copy if newer".
+LSL.Net is available as a convenient NuGet package. You can install LSL.Net using any of the following methods:
-
+.NET CLI:
-From now on, whenever a target in the solution is built, lsl.dll will be copied into the build directory.
+```
+dotnet add package LSL.Net --version
+```
+
+NuGet package manager:
+
+```
+Install-Package LSL.Net -Version
+```
+
+PackageReference:
+
+```
+
+```
+
+Replace `` with the specific version number of LSL.Net you wish to use.
+
+In addition to installing LSL.Net, you will need to install the appropriate liblsl runtime package(s) for your target platform(s). There are separate NuGet packages that contain liblsl native binaries for the most common platforms, named [```LSL.Net.runtime.[RID]```](https://www.nuget.org/packages?q=LSL.Net.runtime), where `[RID]` represents the runtime identifier for the specific platform. For details on runtime identifiers, refer to the [.NET RID catalog](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog). You can find the list of available native packages and their platform mappings in the [LSL.Net.runtime README](https://github.com/labstreaminglayer/liblsl-Csharp/blob/master/src/LSL.Net.runtime/README.md).
# C# Example Programs
diff --git a/examples/Directory.Build.props b/examples/Directory.Build.props
index 7a68623..f1821f1 100644
--- a/examples/Directory.Build.props
+++ b/examples/Directory.Build.props
@@ -1,6 +1,27 @@
-
+
+
+ Exe
+ false
8.0
+ AnyCPU;x86;x64
+ false
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/HandleMetaData/HandleMetaData.csproj b/examples/HandleMetaData/HandleMetaData.csproj
index 5943752..35e3d84 100644
--- a/examples/HandleMetaData/HandleMetaData.csproj
+++ b/examples/HandleMetaData/HandleMetaData.csproj
@@ -1,11 +1,2 @@
-
- net5.0
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/examples/LSLExamples.csproj b/examples/LSLExamples.csproj
deleted file mode 100644
index 912f39e..0000000
--- a/examples/LSLExamples.csproj
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- netcoreapp5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
- LSLExamples.EntryPoint
-
-
-
-
-
diff --git a/examples/LSLExamples/LSLExamples.csproj b/examples/LSLExamples/LSLExamples.csproj
new file mode 100644
index 0000000..2ff494c
--- /dev/null
+++ b/examples/LSLExamples/LSLExamples.csproj
@@ -0,0 +1,12 @@
+
+
+
+ LSLExamples.EntryPoint
+
+
diff --git a/examples/Main.cs b/examples/LSLExamples/Main.cs
similarity index 100%
rename from examples/Main.cs
rename to examples/LSLExamples/Main.cs
diff --git a/examples/LSLVer/LSLVer.cs b/examples/LSLVer/LSLVer.cs
new file mode 100644
index 0000000..5b61b48
--- /dev/null
+++ b/examples/LSLVer/LSLVer.cs
@@ -0,0 +1,15 @@
+// Port of https://github.com/sccn/liblsl/blob/master/testing/lslver.c
+using System;
+
+namespace LSLExamples
+{
+ internal class LSLVer
+ {
+ static void Main(string[] args)
+ {
+ Console.WriteLine($"LSL version: {LSL.LSL.library_version()}");
+ Console.WriteLine(LSL.LSL.library_info());
+ Console.WriteLine(LSL.LSL.local_clock());
+ }
+ }
+}
diff --git a/examples/LSLVer/LSLVer.csproj b/examples/LSLVer/LSLVer.csproj
new file mode 100644
index 0000000..35e3d84
--- /dev/null
+++ b/examples/LSLVer/LSLVer.csproj
@@ -0,0 +1,2 @@
+
+
diff --git a/examples/ReceiveData/ReceiveData.csproj b/examples/ReceiveData/ReceiveData.csproj
index e5668bc..35e3d84 100644
--- a/examples/ReceiveData/ReceiveData.csproj
+++ b/examples/ReceiveData/ReceiveData.csproj
@@ -1,12 +1,2 @@
-
- net5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/examples/ReceiveDataInChunks/ReceiveDataInChunks.csproj b/examples/ReceiveDataInChunks/ReceiveDataInChunks.csproj
index e5668bc..35e3d84 100644
--- a/examples/ReceiveDataInChunks/ReceiveDataInChunks.csproj
+++ b/examples/ReceiveDataInChunks/ReceiveDataInChunks.csproj
@@ -1,12 +1,2 @@
-
- net5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/examples/ReceiveStringMarkers/ReceiveStringMarkers.csproj b/examples/ReceiveStringMarkers/ReceiveStringMarkers.csproj
index e5668bc..35e3d84 100644
--- a/examples/ReceiveStringMarkers/ReceiveStringMarkers.csproj
+++ b/examples/ReceiveStringMarkers/ReceiveStringMarkers.csproj
@@ -1,12 +1,2 @@
-
- net5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/examples/SendData/SendData.csproj b/examples/SendData/SendData.csproj
index e5668bc..35e3d84 100644
--- a/examples/SendData/SendData.csproj
+++ b/examples/SendData/SendData.csproj
@@ -1,12 +1,2 @@
-
- net5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/examples/SendDataInChunks/SendDataInChunks.csproj b/examples/SendDataInChunks/SendDataInChunks.csproj
index e5668bc..35e3d84 100644
--- a/examples/SendDataInChunks/SendDataInChunks.csproj
+++ b/examples/SendDataInChunks/SendDataInChunks.csproj
@@ -1,12 +1,2 @@
-
- net5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/examples/SendStringMarkers/SendStringMarkers.csproj b/examples/SendStringMarkers/SendStringMarkers.csproj
index e5668bc..35e3d84 100644
--- a/examples/SendStringMarkers/SendStringMarkers.csproj
+++ b/examples/SendStringMarkers/SendStringMarkers.csproj
@@ -1,12 +1,2 @@
-
- net5.0
- Labstreaminglayer C# examples
- 1.14
- 8.0
- Exe
-
-
-
-
diff --git a/img/vs2019_lsl_props.PNG b/img/vs2019_lsl_props.PNG
deleted file mode 100644
index 42670bd..0000000
Binary files a/img/vs2019_lsl_props.PNG and /dev/null differ
diff --git a/liblsl.csproj b/liblsl.csproj
deleted file mode 100644
index 9e7f251..0000000
--- a/liblsl.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- Christian Kothe
- netstandard2.0
- LSL
- Labstreaminglayer C# bindings
- 2.0
- $(DefaultItemExcludes);examples/**
- lsl_csharp
-
-
-
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
new file mode 100644
index 0000000..67cc478
--- /dev/null
+++ b/src/Directory.Build.props
@@ -0,0 +1,17 @@
+
+
+
+
+ true
+
+
+
+ https://github.com/labstreaminglayer/liblsl-Csharp
+ README.md
+ https://github.com/labstreaminglayer/liblsl-Csharp/releases
+ labstreaminglayer;lsl;liblsl
+ true
+ https://github.com/labstreaminglayer/liblsl-Csharp
+ git
+
+
diff --git a/src/LSL.Net.runtime/CopyNativeLib.targets b/src/LSL.Net.runtime/CopyNativeLib.targets
new file mode 100644
index 0000000..ff7cd28
--- /dev/null
+++ b/src/LSL.Net.runtime/CopyNativeLib.targets
@@ -0,0 +1,47 @@
+
+
+ linux
+ liblsl.so
+
+
+
+ osx
+ liblsl.dylib
+
+
+
+ win
+ lsl.dll
+
+
+
+ arm
+ arm64
+ x64
+ x86
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LSL.Net.runtime/Directory.Build.props b/src/LSL.Net.runtime/Directory.Build.props
new file mode 100644
index 0000000..8843899
--- /dev/null
+++ b/src/LSL.Net.runtime/Directory.Build.props
@@ -0,0 +1,28 @@
+
+
+
+
+ 1.16.2
+
+
+
+ false
+ None
+ false
+ false
+ CS2008
+
+
+
+ false
+ false
+ LICENSE
+ true
+
+
+
+
+
+
+
+
diff --git a/src/LSL.Net.runtime/Directory.Build.targets b/src/LSL.Net.runtime/Directory.Build.targets
new file mode 100644
index 0000000..bd659f8
--- /dev/null
+++ b/src/LSL.Net.runtime/Directory.Build.targets
@@ -0,0 +1,74 @@
+
+
+
+ LSL.Net.runtime.$(RID)
+ liblsl runtime library for $(RID)
+
+
+
+ https://github.com/sccn/liblsl/releases/download/v$(LSLRuntimeVersion)/$(NativeAssetFile)
+ $(NativeLibPrefix)lsl.$(NativeLibExt)
+ $(ProjectDir)$(BaseIntermediateOutputPath)$(NativeAssetTitle)/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ runtimes/$(RID)/native
+ runtimes/$(RID)/native/%(FileName)%(Extension)
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_IncludeAdditionalTfmSpecificPackageFilesDependsOn>
+ _IncludeAdditionalTfmSpecificPackageFilesPrepare;
+ _IncludeAdditionalTfmSpecificPackageFiles;
+
+
+
+
+
+
diff --git a/src/LSL.Net.runtime/LICENSE b/src/LSL.Net.runtime/LICENSE
new file mode 100644
index 0000000..3e443e3
--- /dev/null
+++ b/src/LSL.Net.runtime/LICENSE
@@ -0,0 +1,15 @@
+Copyright (C) 2012 Christian A. Kothe
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+This software uses the following libraries:
+
+
+pugixml (https://pugixml.org), MIT. pugixml is Copyright (C) 2006-2018 Arseny Kapoulkine.
+Boost (https://boost.org), Boost Software License
+Loguru (https://github.com/emilk/loguru), Public Domain
+Catch2 (https://github.com/catchorg/Catch2), Boost Software License
diff --git a/src/LSL.Net.runtime/README.md b/src/LSL.Net.runtime/README.md
new file mode 100644
index 0000000..825ca81
--- /dev/null
+++ b/src/LSL.Net.runtime/README.md
@@ -0,0 +1,75 @@
+# LSL.Net runtime packages
+
+The following NuGet packages include binary distributions for major platform runtimes targeted by [liblsl](https://github.com/sccn/liblsl).
+
+| RID | NuGet Package |
+| :------------ | :----------------------------------------------------------: |
+| android-arm | [![LSL.Net.runtime.android-arm-badge]][LSL.Net.runtime.android-arm-nuget] |
+| android-arm64 | [![LSL.Net.runtime.android-arm64-badge]][LSL.Net.runtime.android-arm64-nuget] |
+| android-x64 | [![LSL.Net.runtime.android-x64-badge]][LSL.Net.runtime.android-x64-nuget] |
+| android-x86 | [![LSL.Net.runtime.android-x86-badge]][LSL.Net.runtime.android-x86-nuget] |
+| ios-arm64 | [![LSL.Net.runtime.ios-arm64-badge]][LSL.Net.runtime.ios-arm64-nuget] |
+| linux-arm | [![LSL.Net.runtime.linux-arm-badge]][LSL.Net.runtime.linux-arm-nuget] |
+| linux-arm64 | [![LSL.Net.runtime.linux-arm64-badge]][LSL.Net.runtime.linux-arm64-nuget] |
+| linux-x64 | [![LSL.Net.runtime.linux-x64-badge]][LSL.Net.runtime.linux-x64-nuget] |
+| osx-arm64 | [![LSL.Net.runtime.osx-arm64-badge]][LSL.Net.runtime.osx-arm64-nuget] |
+| osx-x64 | [![LSL.Net.runtime.osx-x64-badge]][LSL.Net.runtime.osx-x64-nuget] |
+| win-arm64 | [![LSL.Net.runtime.win-arm64-badge]][LSL.Net.runtime.win-arm64-nuget] |
+| win-x64 | [![LSL.Net.runtime.win-x64-badge]][LSL.Net.runtime.win-x64-nuget] |
+| win-x86 | [![LSL.Net.runtime.win-x86-badge]][LSL.Net.runtime.win-x86-nuget] |
+
+[LSL.Net.runtime.android-arm-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.android-arm.svg
+[LSL.Net.runtime.android-arm-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.android-arm
+[LSL.Net.runtime.android-arm64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.android-arm64.svg
+[LSL.Net.runtime.android-arm64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.android-arm64
+[LSL.Net.runtime.android-x64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.android-x64.svg
+[LSL.Net.runtime.android-x64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.android-x64
+[LSL.Net.runtime.android-x86-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.android-x86.svg
+[LSL.Net.runtime.android-x86-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.android-x86
+[LSL.Net.runtime.ios-arm64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.ios-arm64.svg
+[LSL.Net.runtime.ios-arm64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.ios-arm64
+[LSL.Net.runtime.linux-arm-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.linux-arm.svg
+[LSL.Net.runtime.linux-arm-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.linux-arm
+[LSL.Net.runtime.linux-arm64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.linux-arm64.svg
+[LSL.Net.runtime.linux-arm64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.linux-arm64
+[LSL.Net.runtime.linux-x64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.linux-x64.svg
+[LSL.Net.runtime.linux-x64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.linux-x64
+[LSL.Net.runtime.osx-arm64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.osx-arm64.svg
+[LSL.Net.runtime.osx-arm64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.osx-arm64
+[LSL.Net.runtime.osx-x64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.osx-x64.svg
+[LSL.Net.runtime.osx-x64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.osx-x64
+[LSL.Net.runtime.win-arm64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.win-arm64.svg
+[LSL.Net.runtime.win-arm64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.win-arm64
+[LSL.Net.runtime.win-x64-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.win-x64.svg
+[LSL.Net.runtime.win-x64-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.win-x64
+[LSL.Net.runtime.win-x86-badge]: https://img.shields.io/nuget/v/LSL.Net.runtime.win-x86.svg
+[LSL.Net.runtime.win-x86-nuget]: https://www.nuget.org/packages/LSL.Net.runtime.win-x86
+
+## Usage
+
+```xml
+
+
+
+ Exe
+ net6.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Replace `` with the specific version number of these packages you wish to use.
+
+# License
+
+These packages only bundle the dynamic libraries of [liblsl](https://github.com/sccn/liblsl), thus using the same licensing agreement as liblsl. Please refer to the [LICENSE](./LICENSE) file for more information.
diff --git a/src/LSL.Net.runtime/win-x64/LSL.Net.runtime.win-x64.csproj b/src/LSL.Net.runtime/win-x64/LSL.Net.runtime.win-x64.csproj
new file mode 100644
index 0000000..ab997da
--- /dev/null
+++ b/src/LSL.Net.runtime/win-x64/LSL.Net.runtime.win-x64.csproj
@@ -0,0 +1,15 @@
+
+
+ win-x64
+ liblsl-$(LSLRuntimeVersion)-Win_amd64
+ $(NativeAssetTitle).zip
+ bin
+
+ dll
+
+
+
+ false
+ $(TargetsForTfmSpecificContentInPackage);IncludeAdditionalTfmSpecificPackageFiles
+
+
diff --git a/src/LSL.Net.runtime/win-x64/build/net35/LSL.Net.runtime.win-x64.targets b/src/LSL.Net.runtime/win-x64/build/net35/LSL.Net.runtime.win-x64.targets
new file mode 100644
index 0000000..efab157
--- /dev/null
+++ b/src/LSL.Net.runtime/win-x64/build/net35/LSL.Net.runtime.win-x64.targets
@@ -0,0 +1,21 @@
+
+
+
+
+
+ True
+
+
+
+
+ x64\
+
+
+
+ PreserveNewest
+ %(Dir)%(Filename)%(Extension)
+ False
+
+
+
diff --git a/src/LSL.Net.runtime/win-x86/LSL.Net.runtime.win-x86.csproj b/src/LSL.Net.runtime/win-x86/LSL.Net.runtime.win-x86.csproj
new file mode 100644
index 0000000..db98b81
--- /dev/null
+++ b/src/LSL.Net.runtime/win-x86/LSL.Net.runtime.win-x86.csproj
@@ -0,0 +1,15 @@
+
+
+ win-x86
+ liblsl-$(LSLRuntimeVersion)-Win_i386
+ $(NativeAssetTitle).zip
+ bin
+
+ dll
+
+
+
+ false
+ $(TargetsForTfmSpecificContentInPackage);IncludeAdditionalTfmSpecificPackageFiles
+
+
diff --git a/src/LSL.Net.runtime/win-x86/build/net35/LSL.Net.runtime.win-x86.targets b/src/LSL.Net.runtime/win-x86/build/net35/LSL.Net.runtime.win-x86.targets
new file mode 100644
index 0000000..d359866
--- /dev/null
+++ b/src/LSL.Net.runtime/win-x86/build/net35/LSL.Net.runtime.win-x86.targets
@@ -0,0 +1,21 @@
+
+
+
+
+
+ True
+
+
+
+
+ x86\
+
+
+
+ PreserveNewest
+ %(Dir)%(Filename)%(Extension)
+ False
+
+
+
diff --git a/src/LSL.Net.slnf b/src/LSL.Net.slnf
new file mode 100644
index 0000000..360f71f
--- /dev/null
+++ b/src/LSL.Net.slnf
@@ -0,0 +1,10 @@
+{
+ "solution": {
+ "path": "..\\LSL.Net.sln",
+ "projects": [
+ "src\\LSL.Net.runtime\\win-x64\\LSL.Net.runtime.win-x64.csproj",
+ "src\\LSL.Net.runtime\\win-x86\\LSL.Net.runtime.win-x86.csproj",
+ "src\\LSL.Net\\LSL.Net.csproj"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/src/LSL.Net/LSL.Net.csproj b/src/LSL.Net/LSL.Net.csproj
new file mode 100644
index 0000000..1186840
--- /dev/null
+++ b/src/LSL.Net/LSL.Net.csproj
@@ -0,0 +1,29 @@
+
+
+ LSL.Net is a cross-platform C# binding of lab streaming layer
+ true
+
+ MIT
+ true
+ snupkg
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
diff --git a/LSL.cs b/src/LSL.Net/LSL.cs
similarity index 98%
rename from LSL.cs
rename to src/LSL.Net/LSL.cs
index bb7137d..6a35e88 100644
--- a/LSL.cs
+++ b/src/LSL.Net/LSL.cs
@@ -1,4 +1,7 @@
using System;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
using System.Runtime.InteropServices;
namespace LSL
@@ -94,6 +97,11 @@ Note that significantly larger numbers can cause the timeout to be invalid on so
*/
public static int library_version() { return dll.lsl_library_version(); }
+ /**
+ * Get a string containing library information.
+ */
+ public static string library_info() { return Marshal.PtrToStringAnsi(dll.lsl_library_info()); }
+
/**
* Obtain a local system time stamp in seconds. The resolution is better than a millisecond.
* This reading can be used to assign time stamps to samples as they are being acquired.
@@ -893,6 +901,28 @@ protected InternalException(System.Runtime.Serialization.SerializationInfo info,
class dll
{
+#if NET35
+ static dll()
+ {
+ var searchPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+
+ //if (Environment.Is64BitProcess)
+ if (IntPtr.Size == 8)
+ searchPath = Path.Combine(searchPath, "x64");
+ else
+ searchPath = Path.Combine(searchPath, "x86");
+
+ if (Directory.Exists(searchPath))
+ {
+ Trace.WriteLine($"Search LSL dynamic library in {searchPath}.");
+ SetDllDirectory(searchPath);
+ }
+ }
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern bool SetDllDirectory(string path);
+#endif
+
// Name of the binary to include -- replace this if the native library has a differentname
const string libname = "lsl";
@@ -902,6 +932,9 @@ class dll
[DllImport(libname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)]
public static extern int lsl_library_version();
+ [DllImport(libname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)]
+ public static extern IntPtr lsl_library_info();
+
[DllImport(libname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, ExactSpelling = true)]
public static extern double lsl_local_clock();