aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bindings/cs/.gitignore3
-rw-r--r--bindings/cs/LibSurviveBinding.sln (renamed from csharp-binding/LibSurviveBinding.sln)0
-rw-r--r--bindings/cs/LibSurviveBinding/Binding.cs (renamed from csharp-binding/LibSurviveBinding/Binding.cs)0
-rw-r--r--bindings/cs/LibSurviveBinding/Config_entry.cs (renamed from csharp-binding/LibSurviveBinding/Config_entry.cs)0
-rw-r--r--bindings/cs/LibSurviveBinding/LibSurviveBinding.csproj (renamed from csharp-binding/LibSurviveBinding/LibSurviveBinding.csproj)4
-rw-r--r--bindings/cs/LibSurviveBinding/LightcapElement.cs (renamed from csharp-binding/LibSurviveBinding/LightcapElement.cs)0
-rw-r--r--bindings/cs/LibSurviveBinding/Program.cs (renamed from csharp-binding/LibSurviveBinding/Program.cs)49
-rw-r--r--bindings/cs/LibSurviveBinding/SurviveContext.cs (renamed from csharp-binding/LibSurviveBinding/SurviveContext.cs)0
-rw-r--r--bindings/cs/LibSurviveBinding/SurviveObject.cs (renamed from csharp-binding/LibSurviveBinding/SurviveObject.cs)0
-rw-r--r--bindings/cs/LibSurviveBinding/SurvivePose.cs (renamed from csharp-binding/LibSurviveBinding/SurvivePose.cs)0
-rw-r--r--bindings/cs/LibSurviveBinding/config_group.cs (renamed from csharp-binding/LibSurviveBinding/config_group.cs)0
-rw-r--r--csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.dllbin8192 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.pdbbin1044 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/libsurvive.dllbin365056 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/libsurvive.dllbin365056 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfo.cs23
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfoInputs.cache1
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.CoreCompileInputs.cache1
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.FileListAbsolute.txt12
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csprojResolveAssemblyReference.cachebin480497 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.dllbin8192 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.pdbbin1044 -> 0 bytes
-rw-r--r--csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.cache5
-rw-r--r--csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.props18
-rw-r--r--csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.targets10
25 files changed, 27 insertions, 99 deletions
diff --git a/bindings/cs/.gitignore b/bindings/cs/.gitignore
new file mode 100644
index 0000000..6d14531
--- /dev/null
+++ b/bindings/cs/.gitignore
@@ -0,0 +1,3 @@
+*.dll
+obj/
+bin/ \ No newline at end of file
diff --git a/csharp-binding/LibSurviveBinding.sln b/bindings/cs/LibSurviveBinding.sln
index 539470c..539470c 100644
--- a/csharp-binding/LibSurviveBinding.sln
+++ b/bindings/cs/LibSurviveBinding.sln
diff --git a/csharp-binding/LibSurviveBinding/Binding.cs b/bindings/cs/LibSurviveBinding/Binding.cs
index f4f0652..f4f0652 100644
--- a/csharp-binding/LibSurviveBinding/Binding.cs
+++ b/bindings/cs/LibSurviveBinding/Binding.cs
diff --git a/csharp-binding/LibSurviveBinding/Config_entry.cs b/bindings/cs/LibSurviveBinding/Config_entry.cs
index 85a6701..85a6701 100644
--- a/csharp-binding/LibSurviveBinding/Config_entry.cs
+++ b/bindings/cs/LibSurviveBinding/Config_entry.cs
diff --git a/csharp-binding/LibSurviveBinding/LibSurviveBinding.csproj b/bindings/cs/LibSurviveBinding/LibSurviveBinding.csproj
index e3be07c..646c16d 100644
--- a/csharp-binding/LibSurviveBinding/LibSurviveBinding.csproj
+++ b/bindings/cs/LibSurviveBinding/LibSurviveBinding.csproj
@@ -11,4 +11,8 @@
</None>
</ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NETCore.App" Version="2.0.1" />
+ </ItemGroup>
</Project>
diff --git a/csharp-binding/LibSurviveBinding/LightcapElement.cs b/bindings/cs/LibSurviveBinding/LightcapElement.cs
index ca51fb9..ca51fb9 100644
--- a/csharp-binding/LibSurviveBinding/LightcapElement.cs
+++ b/bindings/cs/LibSurviveBinding/LightcapElement.cs
diff --git a/csharp-binding/LibSurviveBinding/Program.cs b/bindings/cs/LibSurviveBinding/Program.cs
index 7ae8e76..b6d0d8f 100644
--- a/csharp-binding/LibSurviveBinding/Program.cs
+++ b/bindings/cs/LibSurviveBinding/Program.cs
@@ -6,61 +6,52 @@ namespace LibSurVive
class Program
{
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
- static extern IntPtr survive_init_internal(int argc, char[] args);
+ static extern IntPtr survive_init_internal(int argc, string[] args);
public delegate void raw_pose_func(IntPtr so, byte lighthouse, IntPtr pose);
public delegate void lighthouse_pose_func(IntPtr ctx, byte lighthouse, IntPtr lighthouse_pose, IntPtr object_pose);
+ public delegate void light_process_func( IntPtr so, int sensor_id, int acode, int timeinsweep,
+ UInt32 timecode, UInt32 length, UInt32 lighthouse);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
static extern void survive_install_raw_pose_fn(IntPtr ctx, raw_pose_func fbp);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
static extern void survive_install_lighthouse_pose_fn(IntPtr ctx, lighthouse_pose_func fbp);
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
+ static extern void survive_install_light_fn(IntPtr ctx, light_process_func fbp);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
static extern int survive_startup(IntPtr ctx);
[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
static extern void survive_cal_install(IntPtr ctx);
- public static lighthouse_pose_func lighthouse_Pose_Func { get; private set; }
- public static raw_pose_func raw_Pose_Func { get; private set; }
+ [DllImport("libsurvive", CallingConvention = CallingConvention.StdCall)]
+ static extern int survive_poll(IntPtr ctx);
static void Main(string[] args)
{
- IntPtr context = survive_init_internal(0, null);
-
- lighthouse_Pose_Func = LighthousPos;
- survive_install_lighthouse_pose_fn(context, lighthouse_Pose_Func);
- raw_Pose_Func = PositionUpdate;
- survive_install_raw_pose_fn(context, raw_Pose_Func);
-
- try
- {
- int a = survive_startup(context);
- //survive_cal_install(context);
- }
- catch (Exception)
- {
-
- throw;
- }
-
- bool running = true;
-
+ IntPtr context = survive_init_internal(args.Length, args);
+ survive_install_lighthouse_pose_fn(context, LighthousPos);
+ survive_install_raw_pose_fn(context, PositionUpdate);
+ survive_install_light_fn(context, LightUpdate);
- Console.WriteLine("Hello World!");
+ survive_startup(context);
+ survive_cal_install(context);
- while (running)
- {
- Console.ReadLine();
- }
+ while(survive_poll(context) == 0) {}
}
+
+ public static void LightUpdate( IntPtr so, int sensor_id, int acode, int timeinsweep,
+ UInt32 timecode, UInt32 length, UInt32 lighthouse) {
+ Console.WriteLine(timeinsweep);
+ }
public static void PositionUpdate(IntPtr so, byte lighthouse, IntPtr pose)
{
- //Console.WriteLine(pose);
+ Console.WriteLine(pose);
}
public static void LighthousPos(IntPtr ctx, byte lighthouse, IntPtr lighthouse_pose, IntPtr object_pose)
diff --git a/csharp-binding/LibSurviveBinding/SurviveContext.cs b/bindings/cs/LibSurviveBinding/SurviveContext.cs
index 2ba9b7c..2ba9b7c 100644
--- a/csharp-binding/LibSurviveBinding/SurviveContext.cs
+++ b/bindings/cs/LibSurviveBinding/SurviveContext.cs
diff --git a/csharp-binding/LibSurviveBinding/SurviveObject.cs b/bindings/cs/LibSurviveBinding/SurviveObject.cs
index bb9e3cd..bb9e3cd 100644
--- a/csharp-binding/LibSurviveBinding/SurviveObject.cs
+++ b/bindings/cs/LibSurviveBinding/SurviveObject.cs
diff --git a/csharp-binding/LibSurviveBinding/SurvivePose.cs b/bindings/cs/LibSurviveBinding/SurvivePose.cs
index 9808d89..9808d89 100644
--- a/csharp-binding/LibSurviveBinding/SurvivePose.cs
+++ b/bindings/cs/LibSurviveBinding/SurvivePose.cs
diff --git a/csharp-binding/LibSurviveBinding/config_group.cs b/bindings/cs/LibSurviveBinding/config_group.cs
index 8a2f00e..8a2f00e 100644
--- a/csharp-binding/LibSurviveBinding/config_group.cs
+++ b/bindings/cs/LibSurviveBinding/config_group.cs
diff --git a/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.dll b/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.dll
deleted file mode 100644
index 08f1a10..0000000
--- a/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.dll
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.pdb b/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.pdb
deleted file mode 100644
index c8442a1..0000000
--- a/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/LibSurviveBinding.pdb
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/libsurvive.dll b/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/libsurvive.dll
deleted file mode 100644
index 09738c8..0000000
--- a/csharp-binding/LibSurviveBinding/bin/Debug/netcoreapp2.0/libsurvive.dll
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/libsurvive.dll b/csharp-binding/LibSurviveBinding/libsurvive.dll
deleted file mode 100644
index 09738c8..0000000
--- a/csharp-binding/LibSurviveBinding/libsurvive.dll
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfo.cs b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfo.cs
deleted file mode 100644
index 0c76a75..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfo.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-using System.Reflection;
-
-[assembly: System.Reflection.AssemblyCompanyAttribute("LibSurviveBinding")]
-[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
-[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
-[assembly: System.Reflection.AssemblyProductAttribute("LibSurviveBinding")]
-[assembly: System.Reflection.AssemblyTitleAttribute("LibSurviveBinding")]
-[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
-
-// Generated by the MSBuild WriteCodeFragment class.
-
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfoInputs.cache b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfoInputs.cache
deleted file mode 100644
index 27570f7..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.AssemblyInfoInputs.cache
+++ /dev/null
@@ -1 +0,0 @@
-b297cfadb5fc15fdc85ac80d1db8dc47ecc7fa1f
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.CoreCompileInputs.cache b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.CoreCompileInputs.cache
deleted file mode 100644
index d7b7e81..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.CoreCompileInputs.cache
+++ /dev/null
@@ -1 +0,0 @@
-e5ec51aa179849bdaf5ff16a14a375413f2f7a0b
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.FileListAbsolute.txt b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.FileListAbsolute.txt
deleted file mode 100644
index a699d0e..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csproj.FileListAbsolute.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-P:\csharp\LibSurviveBinding\bin\Debug\netcoreapp2.0\LibSurviveBinding.deps.json
-P:\csharp\LibSurviveBinding\bin\Debug\netcoreapp2.0\LibSurviveBinding.runtimeconfig.json
-P:\csharp\LibSurviveBinding\bin\Debug\netcoreapp2.0\LibSurviveBinding.runtimeconfig.dev.json
-P:\csharp\LibSurviveBinding\bin\Debug\netcoreapp2.0\LibSurviveBinding.dll
-P:\csharp\LibSurviveBinding\bin\Debug\netcoreapp2.0\LibSurviveBinding.pdb
-P:\csharp\LibSurviveBinding\obj\Debug\netcoreapp2.0\LibSurviveBinding.csprojResolveAssemblyReference.cache
-P:\csharp\LibSurviveBinding\obj\Debug\netcoreapp2.0\LibSurviveBinding.csproj.CoreCompileInputs.cache
-P:\csharp\LibSurviveBinding\obj\Debug\netcoreapp2.0\LibSurviveBinding.AssemblyInfoInputs.cache
-P:\csharp\LibSurviveBinding\obj\Debug\netcoreapp2.0\LibSurviveBinding.AssemblyInfo.cs
-P:\csharp\LibSurviveBinding\obj\Debug\netcoreapp2.0\LibSurviveBinding.dll
-P:\csharp\LibSurviveBinding\obj\Debug\netcoreapp2.0\LibSurviveBinding.pdb
-P:\csharp\LibSurviveBinding\bin\Debug\netcoreapp2.0\libsurvive.dll
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csprojResolveAssemblyReference.cache b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csprojResolveAssemblyReference.cache
deleted file mode 100644
index 94b7814..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.csprojResolveAssemblyReference.cache
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.dll b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.dll
deleted file mode 100644
index 08f1a10..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.dll
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.pdb b/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.pdb
deleted file mode 100644
index c8442a1..0000000
--- a/csharp-binding/LibSurviveBinding/obj/Debug/netcoreapp2.0/LibSurviveBinding.pdb
+++ /dev/null
Binary files differ
diff --git a/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.cache b/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.cache
deleted file mode 100644
index 55c49f2..0000000
--- a/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.cache
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "version": 1,
- "dgSpecHash": "WfCkKm3U/vtoEsgbYzrhLfrfUejWLQZtOI4PCmuZ/c/RM+JDSQotxYTHxQQ6Blgu3cg1aVoZ15gcgmVkgjRwSg==",
- "success": true
-} \ No newline at end of file
diff --git a/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.props b/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.props
deleted file mode 100644
index f4fbbaa..0000000
--- a/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.props
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
- <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
- <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
- <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">P:\csharp\LibSurviveBinding\obj\project.assets.json</ProjectAssetsFile>
- <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
- <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Peter\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
- <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
- <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.6.1</NuGetToolVersion>
- </PropertyGroup>
- <PropertyGroup>
- <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
- </PropertyGroup>
- <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
- <Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\build\netcoreapp2.0\Microsoft.NETCore.App.props" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\build\netcoreapp2.0\Microsoft.NETCore.App.props')" />
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.targets b/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.targets
deleted file mode 100644
index 91fd1c9..0000000
--- a/csharp-binding/LibSurviveBinding/obj/LibSurviveBinding.csproj.nuget.g.targets
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
- </PropertyGroup>
- <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
- <Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
- <Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\build\netcoreapp2.0\Microsoft.NETCore.App.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\build\netcoreapp2.0\Microsoft.NETCore.App.targets')" />
- </ImportGroup>
-</Project> \ No newline at end of file