Bluetooth LE Texas Instruments SensorTag Tutorial

Recently I needed to interface with a Bluetooth LE device that contained a serial interface. I was already experienced with BluetoothSocket programming with serial devices, but after a quick try out with the device, I realised I had no idea of how to approach programming Bluetooth LE devices.

Rather than try and attempt the task with the device I had, which had virtually no documentation, I thought an easier route to learn BLE would be to purchase a BLE device specifically designed for developers wanting to learn BLE programming. I purchased an inexpensive Texas Instruments CC2650 SensorTag (about $US30) and proceeded to work through their documentation and other example java code I found on the internet.

The result here is not actually a tutorial, but a VS solution containing two projects demonstrating how to program the TI SensorTag. Each project contains a Word doc that describes each project, the docs also contains links to the CC2650 SensorTag documentation and links to the source code of a couple of very good BLE videos. More than enough to get any Xamarin programmer into BLE.

Both projects in the solution achieve exactly the same result, it is how they get there that is important from a Xamarin or C# point of view.

The first project – Android Weather Station is more or less a direct port of the code from the video, simply translated from Java to C#. In other words, it has a very similar style to many of the other projects you may find in monodroid-sample-master, e.g. BluetoothLeGatt. That is OK, because you have to start somewhere when converting to C#, but if you aren’t familiar with Java, the end result doesn’t look very C# like.

The second project – Xamarin Weather Station attempts to correct that, hence the name change.

Learning to program BLE devices is not a trivial task, so please follow the recommendations given in the two Word docs which hopefully may shorten your learning curve.

You can download the solution from the following link https://www.glmsoftware.com/XamarinProjects/WeatherApp.zip

Posts

  • Hi Graham,

    I would like to download your solution. However, the link provided appears to be broken. If you would be so kind as to provide a new link or forward the the zip to my email (robert"at"igp-inc.com) it would be much appreciated.

    Have a great day!

    Robert

  • GrahamMcKechnieGrahamMcKechnie AUMember ✭✭✭

    Hi Robert,

    Sent you an email with a link at HighTail.

    Graham

  • GrahamMcKechnieGrahamMcKechnie AUMember ✭✭✭

    The broken link is now fixed.

    Graham

  • GasCanGasCan Member ✭✭

    @GrahamMcKechnie Link is broken again, could I get the code. I am looking at a product that has the sensortag embedded and would like to look at the data. Im already receiving the data I just don't understand it yet (only about 1.5 hours into any BLE stuff so Im quite new forgive the ignorance). Thanks in advance.

  • GrahamMcKechnieGrahamMcKechnie AUMember ✭✭✭

    Sorry about that - fixed again

Sign In or Register to comment.