Skip to content

qcjxberin/AllJoynDotNet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AllJoynDotNet

A .NET wrapper for the AllJoyn C Library

Note: This is very much a work in progress!

Features:

  • Code generator that auto-generates the Interop from the AllJoyn C-API, including full code-summaries (make sure you pull the submodule for this to work).
  • Library for Windows Universal, Windows Desktop, Xamarin-Android, and Xamarin-iOS.

What's not working:

  • Besides limited creation of bus attachments, no classes has been done for the rest yet.
  • Generated interop code is mostly untested, but so far seems to work in most places.
  • Xamarin-Android hardly works (ER_OS_ERROR when connecting the BusAttachment).
  • Xamarin-iOS hasn't been started yet (help wanted).

FAQ

Windows 10 UWP already has AllJoyn. Do I need this?

  • The WinRT APIs are far too limited, and the provided code-generation tools can't create proper certifiable services. You still need C++ to create a proper client. When running under UWP, no AllJoyn native library is needed, since the one provided with Windows 10 is used (Xamarin Android deploys the native library, and Desktop you have to manually copy them).

Why?

  • Because I don't like to write too much code in C++. I'm faster in C#. Also building AllJoyn clients often mean running on mobile, so we need a cross platform way like Xamarin

A code sample:

// Create the bus attachment
var bus = new BusAttachment("ServiceTest", true);
bus.Start();
bus.Connect();
Debug.WriteLine("Bus started successfully. Unique name: " + bus.UniqueName);
//Create interface
string interfaceName = "org.test.a1234.AnnounceHandlerTest";
string interfaceQcc = "<node>" +
						$"<interface name='{interfaceName}'>" +
						"  <method name='Foo'>" +
						"  </method>" +
						"</interface>" +
						"</node>";
bus.CreateInterfacesFromXml(interfaceQcc);
//Test if the interface is there
var iface = bus.GetInterface(interfaceName);
var secure = iface.IsSecure;
var name = iface.Name;

About

A .NET wrapper for the AllJoyn C Library (.NET, UWP, Xamarin)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.5%
  • Batchfile 0.5%