Skip to content

Commit

Permalink
Fixed serial number binding for CS
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavidberger committed Oct 13, 2020
1 parent 50f6255 commit fe2c049
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ if(DOTNET)

install(FILES ${CS_BINDINGS} DESTINATION "bin")

file(GLOB_RECURSE CS_DEMO
"${CMAKE_CURRENT_SOURCE_DIR}/bindings/cs/Demo/bin/Release/Demo.*")
if(WIN32)
file(GLOB_RECURSE CS_DEMO
"${CMAKE_CURRENT_SOURCE_DIR}/bindings/cs/Demo/bin/Release/Demo.*")

install(FILES ${CS_DEMO} DESTINATION "bin")
install(FILES ${CS_DEMO} DESTINATION "bin")
endif()
endif()

if(EXISTS /etc/bash_completion.d)
Expand Down
2 changes: 1 addition & 1 deletion bindings/cs/Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void Main() {
while (api.WaitForUpdate()) {
SurviveAPIOObject obj;
while ((obj = api.GetNextUpdated()) != null) {
Console.WriteLine(obj.Name + ": " + obj.LatestPose);
Console.WriteLine(obj.Name + "(" + obj.SerialNumber + ") : " + obj.LatestPose);
}
}

Expand Down
2 changes: 1 addition & 1 deletion bindings/cs/libsurvive.net/SurviveAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SurvivePose LatestPose {

public string Name => Marshal.PtrToStringAnsi(Cfunctions_api.survive_simple_object_name(Aso));

public string SerialNumber => Cfunctions_api.survive_simple_serial_number(Aso);
public string SerialNumber => Marshal.PtrToStringAnsi(Cfunctions_api.survive_simple_serial_number(Aso));

public void Dispose() { Marshal.FreeHGlobal(latestPosePtr); }
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/cs/libsurvive.net/cfunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public static extern SurviveSimpleObjectPtr survive_simple_get_next_object(Survi

[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall,
EntryPoint = "survive_simple_serial_number")]
public static extern string survive_simple_serial_number(SurviveSimpleObjectPtr aso);
public static extern IntPtr survive_simple_serial_number(SurviveSimpleObjectPtr aso);

[DllImport("libsurvive", CallingConvention = CallingConvention.StdCall,
EntryPoint = "survive_simple_wait_for_update")]
Expand Down

0 comments on commit fe2c049

Please sign in to comment.