#Xamarin – #Bluetooth LE plugin version 1.0 (Monkey Robotics finally gets older)

Hello!

It has been some time since I wrote something about BlueTooth Low Energy. I think that the last post that I wrote was the ones about development for Garmin sports smart watchs.

While working with BlueTooth Low Energy devices is common and easy with iOS and Android, with Windows it was somewhat hard. If you work with Xamarin, in the old days we have Monkey Robotics as a common platform to use some BLE features in different projects. But at the end, the best way to work was implement some native code in each platform.

A few days ago I find out that Adrian Secelenau (xabre), has released a package of Xamarin BLE based on Monkey Robotics, which could be considered version 1.0: Xamarin BlueTooth LE.

The truth is that it is quite simple to use and supports the 4 fundamental things to work with BlueTooth

  • Verify the status de BLÉ
  • Discover, connect and disconnect with BLE devices
  • Discover services and characteristics of each BLE device
  • Interact (read and write) with these features

For example, if we create a project for example Xamarin, we see that we can add this package in 2 steps.

 

image

image

We also as we see in the image above also have support for MvvmCross, I know that it is something that will make happy more geeks MVVM as Javier Suarez (@jsuarezruiz) and Josue Yeray (@josueYeray).

As well, surely more forward can migrate / write some example more full for test the package in depth, by now I can tell that the implementation is quite clean and that them examples of code are very useful. For example, here we can see how simple that is accessing the local BLE, check the status of it and subscribe to the DeviceDiscovered() event.

 

image

Greetings @ Toronto

El Bruno

References

Advertisements

#Xamarin – #Bluetooth LE plugin en version 1.0 (Monkey Robotics se hizo mayor)

Hola !

Hace ya varios meses que no pruebo ni escribo nada sobre BlueTooth Low Energy. Creo que lo último que escribí fueron mis posts sobre desarrollo para los smartwatchs deportivos Garmin.

Si bien trabajar con devices BlueTooth Low Energy es algo común con iOS y Android, con Windows era un tanto complicado. En un nivel más abstracto, podiamos usar Xamarin con Monkey Robotics como plataforma común, pero claro, lo mejor era implementar código nativo en cada plataforma.

Hace unos días me entero de que Adrian Secelenau (xabre), ha liberado un package de Xamarin BLE basado en Monkey Robotics, que podría considerarse version 1.0: Xamarin BlueTooth LE.

La verdad es que es bastante simple de utilizar y soporta las 4 cosas fundamentales para trabajar con BlueTooth

  • Verificar el estado de BLE
  • Descubrir, conectar y desconectar con BLE devices
  • Descubrir servicios y características de cada BLE device
  • Interactuar (leer y escribir) con estas características

Por ejemplo, si creamos un projecto de Xamarin de ejemplo, veremos que podemos agregar este paquete en 2 pasos.

image

image

Además como vemos en la imagen anterior tambíen tenemos soporte para MvvmCross, que sé que es algo que pondrá felices a los más frikis de Mvvm como Javi Suarez (@jsuarezruiz), Josue Yeray (@josueYeray).

Pues bíen, seguramente más adelante pueda migrar / escribir algún ejemplo más completo para probar el package en profundidad, por ahora puedo decir que la implementación es bastante limpia y que los ejemplos de código son muy útiles. Por ejemplo, aquí podemos ver lo simple que es acceder al BLE local, verificar el estado del mismo y suscribirse al evento DeviceDiscovered().

image

Saludos @ Toronto

El Bruno

References

#Channel9 – My own #Coding4fun channel (so great!)

Hi !

Long story short: I’m far far away from the Spanish and Latin America community, so this year I’ll try to learn new ways to do some remote collaboration. My first action will be create short videos (~30 minutes) in Spanish and post them in Channel 9.

So the first one is a quick tour on how to create a Windows Universal App which connect with a Bluetooth Low Energy device.

Clipboard03

Note: I still don’t know how to add subtitles to the video. As soon as I learn, I’ll try to add English subtitles to the contents.

All the code for this posts will be available in GithHub https://github.com/elbruno/Channel9/tree/gh-pages/2016%2003%20BLE

Greetings @ Toronto

– El Bruno

References

#Garmin – Next Challenge: #ConnectIQ SDK & #MonekyC

Clipboard02

Hello!

The process of installation in Toronto is taking shape. While I continue with the steps necessary to live here, I give me the luxury of jogging at – 10 ° C to learn a little.

Best of all this, is that the past February 14, Pao gave me a Garmin Forerunner 235 to replace my M400 Polar, already a bit old. After giving some kilometers to the legs, I began to know the ecosystem of Garmin, the truth is that it has left me quite stunned.

In addition to its sports capabilities based on own sensors as the Heart Rate, GPS, etc.; the smartwatch is a BLE connection constant with the smartphone. When vi BLE, began to see whether there was the possibility of doing “more” with the Garmin.

I gave a good taste, when I got to the Connect IQ SDK, which is the basis for developing apps for Garmin devices. As in all these cases, I didn’t expect to do anything, but I’ve taken me a pleasant surprise: Connect IQ SDK supports Windows, Android, and iOS.

Now my next step is to use Visual Studio 2015 as development tool, which is going to be some kind of weird. I’ve just found that the programming language is Monkey C. Which is something completely new for me. I have seen that it is a mixture between Java and C, which can give me many fun times.

As well, to see that I can get the Garmin. And even compare it with other SmartWatchs who worked with their SDKs, such as the Microsoft Band and the Pebble.

12729172_10154696739543475_7717662869701989285_n

Saludos @ Toronto

-El Bruno

References

#Garmin – Próximo desafio: #ConnectIQ SDK y #MonekyC

Clipboard02

Hola !

El proceso de instalación en Toronto va tomando forma. Mientras sigo con los trámites necesarios para vivir aquí, me puedo dar el lujo de salir a correr a -10ºC para conocer un poco.

Lo mejor de todo esto, es que el pasado 14 de Febrero, Pao me regaló un Garmin Forerunner 235 para reemplazar a mi Polar M400, que ya un poco viejo. Después de darle un poco de Kilómetros a las piernas, empecé a conocer el ecosistema de Garmin, la verdad es que me ha dejado bastante asombrado.

Además de sus capacidades deportivas que se basan en los sensores propios como el Heart Rate, GPS, etc.; el smartwatch tiene una conexión BLE constante con el smartphone. Cuando ví lo de BLE, comencé a ver si existía la posiblidad de hacer “algo más” con el Garmin.

Me dí un buen gusto, cuando llegué al Connect IQ SDK, que es la base para desarrollas apps para devices Garmin. Como en todos estos casos, no esperaba poder hacer nada, pero me he llevado una agradable sorpresa: Connect IQ SDK soporta Windows, Android e iOS.

Ahora solo me queda ver como montar los proyectos con Visual Studio 2015. Porque, no lo he comentado, el lenguaje de programación es Monkey C. Algo completamente nuevo para mi, y que he visto que es una mezcla entre Java y C, que puede darme mucha alegrías.

Pues bien, a ver que puedo sacar del Garmin. E inclusive compararlo con otros SmartWatchs con los que trabajado con sus SDKs, como la Microsoft Band y el Pebble.

12729172_10154696739543475_7717662869701989285_n

 

Saludos @ Toronto

-El Bruno

References

[#XAMARIN] Estimote beacons + #StarWars = true

Hi!

I’m going to share a couple of posts on Xamarin and Beacons in the next few days. I’m going to use Estimote for the first posts. So, today I realize that some beacons run out of battery.

So, a normal tech dude will throw them out. Me, on the other side, think to open them to see what’s inside (I know, bye bye warranty). But I was shocked when inside the beacon I found a … Millennium Falcon !!!

image

Greetings @ Madrid

-El Bruno

References

[#XAMARIN] Estimote beacons + #StarWars = true

Hola!

En los próximos días escribiré un par de posts sobre beacons y Xamarin. Los que utilizaré para los primeros ejemplos serán los de Estimote. Hoy cuando revisaba alguno de ellos me he dado cuenta de que no tenían más batería.

Y claro como son descartables, se me ocurrio ver que tenían dentro (además de perder la garantía automáticamente). Lo que más me sorprendió fue que dentro tienen … un Millennium Falcon !!!

image

Saludos @ Madrid

-El Bruno

References

#WINDOWS10- Display Heart Rate Band battery status in a Windows Universal App #BLE

Hola!

Series

1. Pair Heart Rate Band using Bluetooth LE to be used in a Windows Universal App

2. Create a Windows Universal App and access to Heart Rate Band information

3. Display Heart Rate Band battery status in a Windows Universal App

In my previous post, I wrote a series of steps to create a Windows Universal App and using this app read information from a Heart Rate Band. This band also exposes the battery charge as a characteristics, so we need to update our package manifest to read this value.

Now we can access to a device Service to read the battery charge value. In order to do this, we can use these lines of code

Now we can really Start to have an app displaying all this information.

Saludos @ Madrid

/El Bruno

References

– Polar Heart Rate Sensor H7, http://www.polar.com/us-en/products/accessories/H7_heart_rate_sensor

#WINDOWS10- Mostrar la carga de la batería de la Heart Rate Band en Windows Universal App #BLE

Hola!

Series

1. Emparejar Heart Rate Band via BlueTooth LE para utilizarlo en Windows Universal App

2. Crear una Windows Universal App y mostrar la información de Heart Rate Band

3. Mostrar información de la carga de la batería de Heart Rate Band

En el post anterior vimos cómo crear una Windows Universal App, y configurar la misma para sacar información de las pulsaciones. Si modificamos el manifiesto del proyecto, podemos además mostrar información de la batería del dispositivo. Para esto agregamos la función battery

El siguiente paso es obtener el valor de la carga de la batería. A diferencia del post anterior, en donde recibíamos los valores en un evento, en este caso accederemos a la característica del device y leeremos el valor de la misma.

Esto ya nos permite tener una app donde se muestren los valores del Heart Rate y la carga de la batería.

Saludos @ Madrid

/El Bruno

References

– Polar Heart Rate Sensor H7, http://www.polar.com/us-en/products/accessories/H7_heart_rate_sensor

#WINDOWS10- Display live Heart Rate information in Windows Universal app using Bluetooth LE #BLE

Hola!

Series

1. Pair Heart Rate Band using Bluetooth LE to be used in a Windows Universal App

2. Create a Windows Universal App and access to Heart Rate Band information

In my previous post I wrote on how to connect the heart rate band using Bluetooth and Windows 10. In today’s post I’ll how to quicly create an app to display the heart rate values

1. Let’s create an Windows Universal App

2. Edit package manifest

Add the Bluetooth generic attribute profile [<DeviceCapability Name=bluetooth.genericAttributeProfile>]

Add [<Device Id=any>] to connect with any device

Add the heart rate service[<Function Type=name:heartRate/>]

3. Nos let’s write some source code. In the Windows Load event, we will analyze the loca Devices collection and search for the name of our device “Polar H7 498C1817”

4. Once we found the device, is time to get the device service. This BLE Service is the entry point for the characteristics of the device. This device is simple enough, and based on our settings it only publish Heart Rate information. So let-s subscribe to the ValueChanged event and enable the Notify mode.

5. Now let’s process the sensor information. We get a byte array wand the 2nd byte is the current HR value

Next one, a full app interacting with the polar device.

Saludos @ Madrid

/El Bruno

References

– Polar Heart Rate Sensor H7, http://www.polar.com/us-en/products/accessories/H7_heart_rate_sensor