Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove library extractor #18

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ This is a .NET wrapper around [libplctag](https://github.com/kyle-github/libplct
Download from [nuget.org](https://www.nuget.org/packages/libplctag/).
It was inspired by [libplctag-csharp](https://github.com/mesta1/libplctag-csharp).

This wrapper simply embeds all the runtimes for each possible platform. On startup of an application, it checks if the runtime is present on the filesystem, and if it isn't it extracts the appropriate one.
This allows consuming applications to easily comply with libplctag's [licensing model](https://github.com/kyle-github/libplctag/blob/master/LICENSE) - you simply need to advise users that they should replace plctag.dll (or plctag.so) with their own version.

## Goals

* Package the libplctag functionality in a way that is convenient to use for .NET projects (i.e. publish on nuget.org).
* Be cross-platform: It should support any platform that libplctag can be built for, and supports .NET Standard 2.0
* Make it easy for package consumers to comply with libplctag's [licensing model](https://github.com/kyle-github/libplctag/blob/master/LICENSE).
* A minimal layer that bridges the gap between libplctag's raw tag handles, and a strongly-typed .NET object.

## Notes
Expand Down Expand Up @@ -73,9 +69,6 @@ namespace ExampleConsoleApp
static void Main(string[] args)
{

// Load a special version of the dll
plctag.LoadDll("My_plctag.dll");

var handle = plctag.create("protocol=ab_eip&gateway=192.168.0.10&path=1,0&cpu=LGX&elem_size=4&elem_count=1&name=MY_DINT", 1000);

while (plctag.status(handle) == 1)
Expand Down
101 changes: 0 additions & 101 deletions src/libplctag/LibraryExtractor.cs

This file was deleted.

5 changes: 0 additions & 5 deletions src/libplctag/libplctag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ public static class plctag

const string DLL_NAME = "plctag";

static plctag()
{
LibraryExtractor.Init();
}

[DllImport(DLL_NAME, EntryPoint = "plc_tag_create", CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 create([MarshalAs(UnmanagedType.LPStr)] string lpString, int timeout);

Expand Down
12 changes: 1 addition & 11 deletions src/libplctag/libplctag.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@
</PropertyGroup>

<ItemGroup>
<None Remove="runtime\linux_x64\libplctag.so" />
<None Remove="runtime\linux_x86\libplctag.so" />
<None Remove="runtime\win_x64\plctag.dll" />
<None Remove="runtime\win_x86\plctag.dll" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="runtime\linux_x64\libplctag.so" />
<EmbeddedResource Include="runtime\linux_x86\libplctag.so" />
<EmbeddedResource Include="runtime\win_x64\plctag.dll" />
<EmbeddedResource Include="runtime\win_x86\plctag.dll" />
<None Update="runtimes\**" Pack="true" PackagePath="runtimes" />
</ItemGroup>

<ItemGroup>
Expand Down