Giter VIP home page Giter VIP logo

iotivitydotnet's Introduction

IoTivityDotNet

A .NET Wrapper around the IoTivity C SDK, and a higher-level API on top for simplicity.

NOTE: WORK IN PROGRESS!

  • Only a limited set of features implemented for now for creating, discovering and controlling devices.
  • Only Windows Win32 + UWP supported (however not on ARM yet)
  • Xamarin support is in the works...
  • Build generates .NET Standard 1.2 nuget packages but will only work with .NET 4.5.1+ and UWP (until I get the native packages needed to work).

####Usage

To use, first initialize the Iotivity service:

 IotivityNet.Service.Initialize(IotivityNet.ServiceMode.Client);

You can then search for device resources using Device Discovery:

var svc = new IotivityDotNet.DiscoverResource("/oic/res");
svc.ResourceDiscovered += (s, e) =>
{
    Console.WriteLine($"Device Discovered @ {e.Response.DeviceAddress}");
};
svc.Start();

When you're done, shut down the Iotivity service:

await IotivityNet.Service.Shutdown();

See the .NET Console app for examples of creating devices (Server.cs) and finding/controlling devices (Client.cs)

Make sure you deploy the obtbstack.dll file in the x86 and x64 folders (See the test app, or use the generated nuget package).

Notes

UWP can't network loop-back and discover devices in its own process, so you can't run a client and a server in the same app. Try starting the .NET Console app which host devices, and then run the UWP app to discover them.

iotivitydotnet's People

Contributors

dotmorten avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.