Skip to content
Mbed Cloud SDK for .NET
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
Examples
MbedCloudSDK
Playground
Templates/MbedCloudSDK.Templates.ConnectedDevices
Tests
docs/news
scripts
tools
.dockerignore
.gitignore
CHANGELOG.md
CONTRIBUTING.md
Deploy.Dockerfile
LICENSE
MbedCloudSDK.sln
README.md
TestServer.Dockerfile
appveyor.yml
ar.doxygen
build.cake
build.ps1
build.sh
cake.config
docker-compose.yml
docs.md

README.md

Mbed Cloud SDK for .NET

License CircleCI codecov

The Mbed Cloud SDK gives developers access to the full Mbed suite using .NET Core 2.0.

If you want to contribute to creating a SDK for another language the work is greatly appreciated and you can read more about the process here.

Installation

  1. Download the .NET Core SDK from here. There are installers for Windows, Linux and Mac.
  2. Create a new console application
dotnet new console -o myApp
cd myApp
  1. Install the MbedCloudSDK in your project
dotnet add package Mbed.Cloud.SDK
dotnet build
  1. To use the SDK you'll need an Api Key, which you can get from the Mbed Cloud Portal.

Example Usage

The following sample lists the first five devices in your Device Directory.

namespace demo
{
    using System;
    using System.Linq;
    using MbedCloudSDK.Common;
    using MbedCloudSDK.Connect.Api;

    class Program
    {
        static void Main(string[] args)
        {
            // create new configuration object. When autostartNotifications is true, you don't need to open a notification channel manually
            var config = new Config(apiKey: "<your api key>", autostartNotifications: true);
            var connect = new ConnectApi(config);

            // lists the first 50 connectedDevices
            var connectedDevices = connect.ListConnectedDevices();

            // get the first connected device
            var val = connectedDevices.FirstOrDefault()
                                        // list the resources
                                        ?.ListResources()
                                        // get the first resource that matches the path /3201/0/5853
                                        ?.FirstOrDefault(d => d.Path == "/3201/0/5853")
                                        // get the value of the resource
                                        ?.GetResourceValue();

            Console.WriteLine(val);
        }
    }
}

Further examples can be found in the Examples folder of this repository.

Documentation

See full documentation and API reference here.

Contributing

Mbed Cloud SDK for .NET is open source and we would like your help; there is a brief guide on how to get started in CONTRIBUTING.md.

Licence

Mbed Cloud SDK for .NET is free-to-use and licensed under the Apache License 2.0. Please see LICENSE file for more information.

You can’t perform that action at this time.