i cant seem to get my bluetooth module to function correctly with my fez cerberus board. Copied the Velloso Bluetooth.cs file into my project and using the code below real quick to just see if my mobile phone can see the bluetooh module but it doesnt work, project compiles fine and runs but not seeing any bluetooth devices from my mobile phone for the gadgeteer. Any help would be appreciated…
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using Gadgeteer.Modules.Velloso;
namespace GadgeteerApp1
{
public partial class Program
{
Bluetooth bluetooth = new Bluetooth(6);
Bluetooth.Client client;
Bluetooth.Host host;
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
try
{
client = bluetooth.ClientMode;
bluetooth.SetDeviceName("gadgeteer");
bluetooth.SetPinCode("1234");
client.EnterPairingMode();
bluetooth.BluetoothStateChanged += new Bluetooth.BluetoothStateChangedHandler(bluetooth_BluetoothStateChanged);
bluetooth.DataReceived += new Bluetooth.DataReceivedHandler(bluetooth_DataReceived);
//bluetooth.DataReceived += new Bluetooth.DataReceivedHandler(bluetooth_DataReceived);
Debug.Print("Program Started...");
}
catch (Exception E)
{
Debug.Print(E.Message);
}
}
void bluetooth_BluetoothStateChanged(Bluetooth sender, Bluetooth.BluetoothState btState)
{
if (btState == Bluetooth.BluetoothState.Connected)
{
//timer.Start();
Debug.Print("connected BT");
}
else
{
//timer.Stop();
Debug.Print("disconnected BT");
}
}
private void bluetooth_DataReceived(Bluetooth sender, string data)
{
//Debug.Print(data);
}
}
}