Bluetooth development on Windows mobile 6 C#
- by cheesebunz
Hi everyone, i recently started on a project which is a puzzle slider game. This application will be using the Bluetooth, and i'm working on the mobile,Samsung omnia i900. This is how my application will work. Any user with this Samsung device plays the game and starts sliding the tiles. There is an option to search and connect to other users with the same device and application, so that they can solve the puzzle together.
Right now, i'm working on the Bluetooth Part but am still new to the API. I'm using the 32feet.NET inthehandpersonal.net class library while encountering much difficulties. I am able to search for devices by using:
private void btnSearch_Click(object sender, EventArgs e)
{
BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable;
BluetoothRadio myRadio = BluetoothRadio.PrimaryRadio;
lblSearch.Text = "" + myRadio.LocalAddress.ToString();
bluetoothClient = new BluetoothClient();
Cursor.Current = Cursors.WaitCursor;
BluetoothDeviceInfo[] bluetoothDeviceInfo = { };
bluetoothDeviceInfo = bluetoothClient.DiscoverDevices(10);
comboBox1.DataSource = bluetoothDeviceInfo;
comboBox1.DisplayMember = "DeviceName";
comboBox1.ValueMember = "DeviceAddress";
comboBox1.Focus();
Cursor.Current = Cursors.Default;
}
Well, to be honest this is a rip off from some sources i found on the internet but i do understand this part. Next i went on to trying to sending a simple "testing.txt" file and i'm stucked at it. I think i will be using something like the OBEX and Obexwebrequest, obexwebresponse, Uri etc. Could anyone explain it in simple terms for me so that i could understand what they are so that i could continue pairing and etc on Bluetooth development.
Sorry making it this long, really appreciate if anyone did waste some time reading it :). Hope alanM sees this :) i'm using their bluetooth library.