Minimal Gadgeteer Bluetooth module test app
This is a sample Gadgeteer app that will show you how to use the Bluetooth module to send serial data to a device connected over the Serial Port.
This example uses the driver from Eduard Velloso, as described at http://eduardovelloso.com/2012/04/02/net-gadgeteer-bluetooth-drivers/ and downloadable from https://gadgeteerbluetooth.codeplex.com/ but with the modification I posted about in the Codeplex discussion. This file is included in the project so you don’t need to download it or to incorporate it in the project; you will however need to copy the bluetooth.cs file into other projects you want to use it with.
This is a .Net 4.1 application, running on a Fez Hydra (although should work on any Gadgeteer board). Snipped from my Device Capabilities report shows:
ClrInfo.clrVersion: 4.1.2821.0
ClrInfo.targetFrameworkVersion: 4.1.2821.0
SolutionReleaseInfo.solutionVersion: 4.1.3.1
SolutionReleaseInfo.solutionVendorInfo: Copyright (C) GHI Electronics, LLC
SoftwareVersion.BuildDate: Feb 23 2012
Which is actually the GHI SDK Version 1.0.19 from February 19, 2011 (from the readme). If you’re not using this SDK version, remember to either rip and replace the references, or create a new shell (Gadgeteer) application and paste the code itself into your app (remember to copy over the bluetooth.cs file!)
Images: The first shows my Gadgeteer project board setup - note that the OLED is not connected, but it does run over the top of the cable to Socket 6 for the bluetooth module. Second, there’s a screen grab of the setup in the Gadgeteer designer; note well that the bluetooth module isn’t added, as I wanted to use the modified driver. Finally, there’s a screenshot of everything in action - I’m just using Tera Term to see the text output (and everyone has Tera Term for firmware updating, right )
I’ll record a video of first time connection to show how it all goes together but that may be 24 hours away from being ready; I’ll update this when it’s published. The important thing to know, when pairing the Gadgeteer module for the first time with a Windows PC (could also be other device types) you need to put the device in pairing mode, and that is why the app actually uses the Joystick button press event to trigger that. So plug it in, wait about 5 seconds for the full initialisation of the board - you’ll see it report that “+BTState=1” is recieved and then no additional data comes in - and then press the joystick to go to pairing mode where the red and blue LEDs on the bluetooth module alternate.