Thread Rating:
  • 1 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# Wrapper
16-04-2014, 11:16 AM
Post: #1
C# Wrapper
Hi

I'm obviously missing something obvious but I can't seem to find where to download the C# wrapper. Any pointers?

Many thanks
Garry
Find all posts by this user
16-04-2014, 04:16 PM (This post was last modified: 16-04-2014 04:22 PM by simonc.)
Post: #2
RE: C# Wrapper
(16-04-2014 11:16 AM)Garry Wrote:  I'm obviously missing something obvious but I can't seem to find where to download the C# wrapper. Any pointers?

I'm not sure how far you've got but hopefully one or more of the following will cover things.

You can fetch the code using
Code:
git clone git@github.com:openhome/ohNet.git ohnet

ohNet is a C++ library with bindings for other languages. Code for the C# bindings is available under ohnet/OpenHome/Net/Bindings/Cs

Binary releases are available at http://www.openhome.org/releases/artifacts/ohNet/
Find all posts by this user
16-04-2014, 07:26 PM
Post: #3
RE: C# Wrapper
Thanks Simon. That was what I was missing. I couldn't see the github referenced anywhere on the site.

Now to see if I can get it to work with Xamarin
Find all posts by this user
23-04-2014, 02:25 PM
Post: #4
RE: C# Wrapper
Ok I've been struggling to get this working in Xamarin (for IOS).

Should I be using the ohNet.Net.dll? I've tried adding it to the project but the calls fail. Do I need to static link it (I've only had to do that with native c dll before) or should I add it as a reference.

Many thanks Garry
Find all posts by this user
30-04-2014, 03:47 PM
Post: #5
RE: C# Wrapper
So after some digging it appears the ohnet.net.dll is a .net library... The compiled version of the source code I guess. However if I call Core.Initparams after adding it as a reference I get system.DllNitFoundExceptiion ohNet. Any thoughts this is in Xamarin.
Find all posts by this user
01-05-2014, 12:51 AM
Post: #6
RE: C# Wrapper
Right answering my own question.

I was not looking in the right place. Instead of the OhNet.Net-AnyPlatform download I needed the OhNet-Ios downloads which do include the .a files I was looking for originally. I could then reference the ohnet.net.dll from this folder and also add in additional mtopuch arguments to the Xamarin projects IOS build options to link the .a files (ensure the .a files are added to the project)

My line looks like
-cxx -gcc_flags "-stdlib=libstdc++ -L${ProjectDir} -force_load ${ProjectDir}/libohNetCore.a"

note the -cxx and the need to explicitly state the stdlib

I can now discover devices.

At the moment this only works in the simulator as I am only linking the i86 libs and will need to do the arm variants for the actual device (may well produce a universal lib to get round this)
Find all posts by this user
01-05-2014, 09:02 AM
Post: #7
RE: C# Wrapper
Great, glad to hear you have things working!

And apologies that this thread turned into a bit of a monologue - I've been on holiday.
Find all posts by this user
01-05-2014, 10:07 AM
Post: #8
RE: C# Wrapper
(01-05-2014 09:02 AM)simonc Wrote:  Great, glad to hear you have things working!

And apologies that this thread turned into a bit of a monologue - I've been on holiday.

Thanks Simon. Hope you had a great holiday. You deserve it. Supporting this project must take a lot of time up.

One small question I seem to be able to get away with just linking the ohNetCore.a file for my controlpoint is this correct?
Find all posts by this user
01-05-2014, 10:15 AM
Post: #9
RE: C# Wrapper
(01-05-2014 10:07 AM)Garry Wrote:  One small question I seem to be able to get away with just linking the ohNetCore.a file for my controlpoint is this correct?

ohNetCore.a contains native code (C++ code plus C wrappers to public APIs). You need to statically link this using a command line like the one you posted previously.

You'll also need the C# bindings which are supplied in ohNet.net.dll. You can just reference this from your project in the normal way.
Find all posts by this user
02-05-2014, 03:18 PM
Post: #10
RE: C# Wrapper
(01-05-2014 10:15 AM)simonc Wrote:  
(01-05-2014 10:07 AM)Garry Wrote:  One small question I seem to be able to get away with just linking the ohNetCore.a file for my controlpoint is this correct?

ohNetCore.a contains native code (C++ code plus C wrappers to public APIs). You need to statically link this using a command line like the one you posted previously.

You'll also need the C# bindings which are supplied in ohNet.net.dll. You can just reference this from your project in the normal way.

Thanks Simon. Sorry I should have made my question clearer. I'm already referencing ohnet.net.dll in my project and having linked only libohNetCore.a everything I'm doing seems to be working fine but I was curious what purpose the other .a files in the IOS download served and whether I would need them (I'm only building a control point for AV)

At the moment everything is working well. Do you know of any C# helper classes for de-serialising DIDL-Lite or do I need to spin my own? (not too onerous a task but don't want to reinvent the wheel if I don't have to)

Many thanks
Find all posts by this user


Forum Jump: