Skip to main content

Bluetooth Low Energy dans les applications Windows

Par Stéphane Sibué.

Les objets connectés

Enormément d’objets sont connectés depuis longtemps: DAB, stations météo, … Mais on en parle beaucoup plus depuis qu’il sont devenus plus “intimes” grâce à la miniaturisation.

Il faut des: humains, objets, écrans pour les intéractions, de la connectivité et le cloud pour le stockage et l’intelligence.

Le Bluetooth Low Energy

Technique inventée par Nokia en tant que standard ouvert, basé sur le Bluetooth “classique”. C’est le Bluetooth 4. Débit faible: 1Mb/s mais consomme 10 fois moins que le Bluetooth classique, et la latence de connexion et de transfert ont été réduites. Le scénario classique est: on se connecte, on échange, on se déconnecte.

Le Bluetooth classique possède des profils normalisés mais qui varient selon l’implémentation, résultat l’interopérabilité n’était pas parfaite. Alors qu’avec le BLE c’est bien mieux normalisé. Les services sont listés ici: https://developer.bluetooth.org.

Chaque service possède des caractéristiques (une variable par caractéristique): des UUID (qui sont des Guid). Les caractéristiques possèdent des descripteurs.

WP_20150210_013_processed

Dialoguer en Bluetooth LE avec un device

Pour les démonstrations, c’est un Bluetooth Sensor Tag qui est utilisé, et il va relever température, humidité et pression. Une application universelle est réalisée pour fonctionner sur Windows Phone 8.1 et Windows 8.1.

Il faut déclarer dans les capabilities le BLE: “bluetooth.genericAttributeProfile”. Contrairement à Android et iOS il faut s’appairer à l’appareil avant de dialoguer avec lui.

On indique quel service on souhaite récupérer, on obtient la liste des devices qui le portent, et on a un GattDeviceService qui est le point d’entrée. On récupère alors la caractéristiques par son UUID, qui nous retourne un GattCharacteristic sur lequel on peut lire ou écrire.

Comments

Popular posts from this blog

Gift idea : help your loved ones take their IT skills to the next level

You surely know a special person who works in IT. Learn Kubernetes & Docker enables them to quickly ramp up on those two technologies that one doesn't want to miss in 2021. With smoother operations, better scaling and availability, DevOps tooling, containers and containers orchestration smartly solve many problems that developers and system administrators commonly face. Don't let your loved ones face problems in their IT job : offer them the book that takes them from zero to productive in a matter of days. Grab it now! Get the ebook from Leanpub , Amazon or choose from many retailers . Get the print edition from Lulu .  

Learn Meteor book available

I'm pleased to announce the general release of my Learn Meteor book. It is now available as an ebook or print book from various sources: Learn Meteor print (paperback) on Lulu Learn Meteor ebook on LeanPub Learn Meteor ebook on Barnes & Noble Learn Meteor ebook on iBooks Learn Meteor ebook on Kobo Learn Meteor ebook on Scribd Learn Meteor ebook on Inktera Page Foundry Learn Meteor ebook on 24symbols Learn Meteor ebook on Amazon US Learn Meteor ebook on Amazon UK Learn Meteor ebook on Amazon France Learn Meteor ebook on Amazon Deutschland Learn Meteor ebook on Amazon Canada Learn Meteor ebook on Amazon India Learn Meteor ebook on Amazon Brasil Learn Meteor ebook on Amazon Mexico Learn Meteor ebook on Amazon España Learn Meteor ebook on Amazon Italia Learn Meteor ebook on Amazon Netherlands Learn Meteor ebook on Amazon Japan Learn Meteor ebook on Amazon Australia More sources are coming soon for the print version. Learn Meteor has been a fun expe...

Learn ASP.NET Core: read the book as it is being written

     TL;DR: get the discounted book now using the coupon , then get the full version for free. Thanks to the great acceptance of my previous books, ( Learn WPF MVVM ,  Learn ASP.NET MVC and Learn Meteor ), I'm in the process of writing a fourth one. Learn ASP.NET Core - MVC and DI with .NET Core 1.1 using Visual Studio 2017 teaches you how to quickly get coding using that technology. Just as I did previously, I'm publishing it before it is even finished. Would you like to read it? You can get it for half the price: 50% off the book using that coupon (limited to the first 100 readers and up to august 1st 2017): http://leanpub.com/netcore/c/K9mHH0IzfI2F About 50% of the book is already written, yet it is already available for download as an ebook: PDF, EPUB, MOBI: you choose your format. Over the next days I'll be writing the rest of the book, and publishing updates often. The final book will be ready by au...