Giter Club home page Giter Club logo

metawear-sdk-csharp's Introduction

MetaWear SDK for C# by MBIENTLAB

Platforms License Version

alt tag

SDK for creating MetaWear apps on the Windows platform. The SDK is distributed on NuGet as a platform agnostic, .NET Standard 2.0 assembly.

Also, check out the scripts in the examples folder for sample code.

ADDITIONAL NOTES
Due to its platform agnostic nature, developers will need to plugin their own BLE stack and file i/o code specific to their target environment.

Overview

MetaWear is a complete development and production platform for wearable and connected device applications.

MetaWear features a number of sensors and peripherals all easily controllable over Bluetooth 4.0 Low Energy using this SDK, no firmware or hardware experience needed!

The MetaWear hardware comes pre-loaded with a wirelessly upgradeable firmware, so it keeps getting more powerful over time.

Requirements

License

See the License.

Support

Reach out to the community if you encounter any problems, or just want to chat :)

Getting Started

Installation

The C# SDK is distributed via NuGet and can be installed with the package manager console:

PM> Install-Package MetaWear.CSharp

Usage

MbientLab provides an implementation of the MetaWear API in the Impl namespace. Similiarly to the top level interfaces, the main class in the Impl namespace is the MetaWearBoard class.

To instantiate a MetaWearBoard object, you will need to provide an implementation of the IBluetoothLeGatt and the ILibraryIO interfaces:

using MbientLab.MetaWear.Impl.Platform;

class BluetoothLeGatt : IBluetoothLeGatt {
    // Implementation here
}

class IO : ILibraryIO {
    // Implementation here
}

var metawear = new MetaWearBoard(new BluetoothLeGatt(), new IO());

Once you have your IMetaWearBoard object, you can begin using the SDK features are described in the developers' guide.

Tutorials

Tutorials can be found here.

metawear-sdk-csharp's People

Contributors

lkasso avatar odev-it avatar scaryghost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metawear-sdk-csharp's Issues

Logging not working

In my Xamarin.Forms UWP application I'm trying to get the logging-module to work, however exceptions are always thrown by the SDK. By looking at the code, I saw something odd:

In class "MbientLab.MetaWear.Impl.Logging" there is an internal method, called "CreateLoggersAsync'. In here a TimedTask is executed which - for what I'm able to see - can never return a correct value.

var id = await createLoggerTask.Execute("Did not receive logger id within {0}ms", bridge.TimeForResponse, () => bridge.sendCommand(command));

A command is send to the MetaWear-sensor, but never is a result initialized for the TimedTask. This will automatically result in a TimeOut, or an infinite wait because no result is ever set. I got around this by adding following code (although I have no idea that this is the correct approach):

var id = await createLoggerTask.Execute("Did not receive logger id within {0}ms", bridge.TimeForResponse, () =>
                        {
                            bridge.sendCommand(command);
                            createLoggerTask.SetResult(i);
                        });

When the logs ought to be downloaded the same problem occurs. In the same class in method "DownloadAsyncInner" another TimedTask is executed without ever initializing a result to it:


            var entriesResponse = await queryEntriesTask.Execute("Current log usage not received within {0}ms", bridge.TimeForResponse,
                () => bridge.sendCommand(new byte[] { (byte)LOGGING, Util.setRead(LENGTH) })
            );

So again this always thrown an exception, or wait until the result is set which never will.

Am I missing something, or is it not possible to log using current SDK version (1.0.15)?

Adding a MetaWear.CSharp package to a .net 4.5.1 project

I would like to start a WPF project with this SDK, but during the install I got this error message:
Install-Package : Could not install package 'MetaWear.CSharp 1.1.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.1 ', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Are there any workaround for this?
Could you make it compatible with the latest .net frameworks? 2.0 is very old.

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.