Skip to content

Commit f6fc4ae

Browse files
authored
Merge pull request #1 from labstreaminglayer/defaultargs
Add default argument values to optional parameters
2 parents 006c6c6 + 0466e96 commit f6fc4ae

14 files changed

Lines changed: 168 additions & 144 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<Authors>Christian Kothe</Authors>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>1.1.2</Version>
5+
<Version>1.12.2</Version>
66
</PropertyGroup>
77
</Project>
88

LSL.cs

Lines changed: 65 additions & 101 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# C# bindings
22

33
The is the C# interface to the lab streaming layer. To use it, you need to include the file LSL.cs in
4-
your project, and make sure that the library liblsl32.dll is found (e.g., in your application's root
5-
directory or in a system path).
4+
your project, and make sure that the lsl library (e.g. liblsl32.dll) is found (e.g., in your application's
5+
root directory or in a system path).
6+
7+
If you are deploying for something other than Unity, and on a platform that requires a different binary
8+
than liblsl32.dll (e.g., liblsl64.so on 64-bit Linux, or liblsl64.dylib on Mac OS)
9+
then you need to replace the libname constant in LSL.cs by the corresponding file name.
10+
11+
These example applications can be debugged from within the IDE (i.e. Visual Studio). However, the built
12+
products are DLL files, not EXE files. The DLL files can be run at console with `dotnet my_application`
13+
(from within same folder as my_application.DLL). This will work anywhere the .NET Core Runtime works.
14+
To make a more portable but platform-dependent product, use `dotnet publish -C Debug -r win10-x64`
15+
(or Release instead of Debug) and this will generate an EXE file.
616

7-
If you are deploying on a platform that requires a different binary than liblsl32.dll (e.g., liblsl64.so
8-
on 64-bit Linux, or liblsl64.dylib on Mac OS, then you need to replace the libname constant in LSL.cs
9-
by the corresponding file name).
1017

1118
## C# Example Programs
1219

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk"><ItemGroup>
2-
<ProjectReference Include="..\..\liblsl.csproj" />
3-
</ItemGroup><PropertyGroup><Product>HandleMetaData</Product></PropertyGroup></Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\..\liblsl.csproj" />
4+
</ItemGroup>
5+
<PropertyGroup>
6+
<Product>HandleMetaData</Product>
7+
<OutputType>Exe</OutputType>
8+
<TargetFramework>netcoreapp2.0</TargetFramework>
9+
</PropertyGroup>
10+
</Project>
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk"><ItemGroup>
2-
<ProjectReference Include="..\..\liblsl.csproj" />
3-
</ItemGroup><PropertyGroup><Product>ReceiveData</Product></PropertyGroup></Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\..\liblsl.csproj" />
4+
</ItemGroup>
5+
<PropertyGroup>
6+
<Product>ReceiveData</Product>
7+
<OutputType>Exe</OutputType>
8+
<TargetFramework>netcoreapp2.0</TargetFramework>
9+
</PropertyGroup>
10+
</Project>
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk"><ItemGroup>
2-
<ProjectReference Include="..\..\liblsl.csproj" />
3-
</ItemGroup><PropertyGroup><Product>ReceiveDataInChunks</Product></PropertyGroup></Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\..\liblsl.csproj" />
4+
</ItemGroup>
5+
<PropertyGroup>
6+
<Product>ReceiveDataInChunks</Product>
7+
<OutputType>Exe</OutputType>
8+
<TargetFramework>netcoreapp2.0</TargetFramework>
9+
</PropertyGroup>
10+
</Project>
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk"><ItemGroup>
2-
<ProjectReference Include="..\..\liblsl.csproj" />
3-
</ItemGroup><PropertyGroup><Product>ReceiveStringMarkers</Product></PropertyGroup></Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\..\liblsl.csproj" />
4+
</ItemGroup>
5+
<PropertyGroup>
6+
<Product>ReceiveStringMarkers</Product>
7+
<OutputType>Exe</OutputType>
8+
<TargetFramework>netcoreapp2.0</TargetFramework>
9+
</PropertyGroup>
10+
</Project>

examples/SendData/SendData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static void Main(string[] args)
1111
Random rnd = new Random();
1212

1313
// create stream info and outlet
14-
liblsl.StreamInfo info = new liblsl.StreamInfo("BioSemi", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
14+
liblsl.StreamInfo info = new liblsl.StreamInfo("TestCSharp", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
1515
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
1616
float[] data = new float[8];
1717
while (true)

examples/SendData/SendData.csproj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk"><ItemGroup>
2-
<ProjectReference Include="..\..\liblsl.csproj" />
3-
</ItemGroup><PropertyGroup><Product>SendData</Product></PropertyGroup></Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\..\liblsl.csproj" />
4+
</ItemGroup>
5+
<PropertyGroup>
6+
<Product>SendData</Product>
7+
<OutputType>Exe</OutputType>
8+
<TargetFramework>netcoreapp2.0</TargetFramework>
9+
</PropertyGroup>
10+
</Project>

examples/SendDataInChunks/SendDataInChunks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static void Main(string[] args)
1010
{
1111
Random rnd = new Random();
1212
// create stream info and outlet
13-
liblsl.StreamInfo info = new liblsl.StreamInfo("BioSemi", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
13+
liblsl.StreamInfo info = new liblsl.StreamInfo("TestCSharp", "EEG", 8, 100, liblsl.channel_format_t.cf_float32, "sddsfsdf");
1414
liblsl.StreamOutlet outlet = new liblsl.StreamOutlet(info);
1515

1616
// send data in chunks of 10 samples and 8 channels

0 commit comments

Comments
 (0)