Skip to content

Commit

Permalink
Added v1.6 builds for C#: Updated build script, source files, and bui…
Browse files Browse the repository at this point in the history
…lt DLLs.
  • Loading branch information
Aaron Tang committed Aug 27, 2019
1 parent 687f6f9 commit 4ab7949
Show file tree
Hide file tree
Showing 10 changed files with 1,278 additions and 272 deletions.
Binary file modified builds/csharp/UnityRehamove.dll
Binary file not shown.
Binary file modified builds/csharp/rehamovelib.dll
Binary file not shown.
44 changes: 38 additions & 6 deletions src/csharp/RehamoveDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,55 @@ protected virtual void Dispose(bool disposing) {
}
}

public string port_name {
public SWIGTYPE_p_Smpt_device device {
set {
rehamovelibPINVOKE.RehamoveDevice_port_name_set(swigCPtr, value);
rehamovelibPINVOKE.RehamoveDevice_device_set(swigCPtr, SWIGTYPE_p_Smpt_device.getCPtr(value));
if (rehamovelibPINVOKE.SWIGPendingException.Pending) throw rehamovelibPINVOKE.SWIGPendingException.Retrieve();
}
get {
string ret = rehamovelibPINVOKE.RehamoveDevice_port_name_get(swigCPtr);
SWIGTYPE_p_Smpt_device ret = new SWIGTYPE_p_Smpt_device(rehamovelibPINVOKE.RehamoveDevice_device_get(swigCPtr), true);
if (rehamovelibPINVOKE.SWIGPendingException.Pending) throw rehamovelibPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}

public SWIGTYPE_p_Smpt_device device {
public int battery {
set {
rehamovelibPINVOKE.RehamoveDevice_device_set(swigCPtr, SWIGTYPE_p_Smpt_device.getCPtr(value));
rehamovelibPINVOKE.RehamoveDevice_battery_set(swigCPtr, value);
}
get {
int ret = rehamovelibPINVOKE.RehamoveDevice_battery_get(swigCPtr);
return ret;
}
}

public int mode {
set {
rehamovelibPINVOKE.RehamoveDevice_mode_set(swigCPtr, value);
}
get {
int ret = rehamovelibPINVOKE.RehamoveDevice_mode_get(swigCPtr);
return ret;
}
}

public float current {
set {
rehamovelibPINVOKE.RehamoveDevice_current_set(swigCPtr, value);
}
get {
float ret = rehamovelibPINVOKE.RehamoveDevice_current_get(swigCPtr);
return ret;
}
}

public SWIGTYPE_p_uint16_t pulse_width {
set {
rehamovelibPINVOKE.RehamoveDevice_pulse_width_set(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(value));
if (rehamovelibPINVOKE.SWIGPendingException.Pending) throw rehamovelibPINVOKE.SWIGPendingException.Retrieve();
}
get {
SWIGTYPE_p_Smpt_device ret = new SWIGTYPE_p_Smpt_device(rehamovelibPINVOKE.RehamoveDevice_device_get(swigCPtr), true);
SWIGTYPE_p_uint16_t ret = new SWIGTYPE_p_uint16_t(rehamovelibPINVOKE.RehamoveDevice_pulse_width_get(swigCPtr), true);
if (rehamovelibPINVOKE.SWIGPendingException.Pending) throw rehamovelibPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
Expand Down
28 changes: 28 additions & 0 deletions src/csharp/SWIGTYPE_p_uint16_t.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace UnityRehamove {
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.0
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------


public class SWIGTYPE_p_uint16_t {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;

internal SWIGTYPE_p_uint16_t(global::System.IntPtr cPtr, bool futureUse) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}

protected SWIGTYPE_p_uint16_t() {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}

internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_uint16_t obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
}
}
34 changes: 19 additions & 15 deletions src/csharp/build.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
SET build_directory=../../builds/csharp/
SET precompiled_directory=../../hasomed_precompiled/smpt_rm3_msvc2015_x86_amd64_static
SET dll_build_directory=../../builds/csharp

echo rehamove-integration-lib: Performing the build (C# on Windows)
swig -csharp rehamovelib.i
cl /LD /MD rehamovelib.c rehamovelib_wrap.c /Ferehamovelib.dll /I "%precompiled_directory%/include/low-level/" /I "%precompiled_directory%/include/general" /link "%precompiled_directory%/lib/libsmpt.lib"

echo rehamove-integration-lib: Moving built files into the builds directory
move rehamovelib.dll "%build_directory%"
echo rehamove-integration-lib: Performing the build (v1.6 C# on Windows)

echo rehamove-integration-lib: Cleaning up intermediate build files
del rehamovelib_wrap.c
del rehamovelib.obj
del rehamovelib_wrap.obj
del rehamovelib.lib
del rehamovelib.exp
swig -csharp rehamovelib.i

echo rehamove-integration-lib: Adding in namespace lines for files used in UnityRehamove.dll
cl /LD /MD rehamovelib.c rehamovelib_wrap.c /Ferehamovelib.dll /I "%precompiled_directory%/include/low-level/" /I "%precompiled_directory%/include/mid-level/" /I "%precompiled_directory%/include/general" /link "%precompiled_directory%/lib/libsmpt.lib"

echo }>backspace.cs

Expand All @@ -39,5 +29,19 @@ echo namespace UnityRehamove {>SWIGTYPE_p_Smpt_device.cs
type temp.cs >> SWIGTYPE_p_Smpt_device.cs
type backspace.cs >> SWIGTYPE_p_Smpt_device.cs

copy SWIGTYPE_p_uint16_t.cs temp.cs
echo namespace UnityRehamove {>SWIGTYPE_p_uint16_t.cs
type temp.cs >> SWIGTYPE_p_uint16_t.cs
type backspace.cs >> SWIGTYPE_p_uint16_t.cs

del temp.cs
del backspace.cs
del backspace.cs
del rehamovelib_wrap.c
del rehamovelib.exp
del rehamovelib.lib
del rehamovelib.obj
del rehamovelib_wrap.obj

move rehamovelib.dll "%dll_build_directory%"

echo rehamove-integration-lib: Build complete.
Loading

0 comments on commit 4ab7949

Please sign in to comment.