Bluetooth connection in c# using 32feet

Topics: Bluetooth - Microsoft, Bluetooth - Other
Mar 16, 2012 at 7:05 AM

Hi,

I'm using 32feet bluetooth library for bluetooth communication.

I'm scanning the near by devices and listing it. My requirement is i need to ping the scanned device to connect. That is I need to ask one of the scanned devices to connect my pc.

Please guide me to achieve this.

Thanks in advance.

Regards,

Babu.K

Developer
Mar 18, 2012 at 5:15 PM

I don't know of a general way to remotely cause a specific device to connect to another specific device.  Did I understand correctly that's what you want?

 

If you want to create a data connection to a remote service on a device then use BluetoothClient, to listen for an incoming connection use BluetoothListener, or to have the OS use a remote service then use can use method SetServiceState etc.  See http://32feet.codeplex.com/documentation

Mar 20, 2012 at 8:08 AM

hi, Thanks for your reply, i ve done it with listener and bluetooth client. Is there any possibilty to send and recieve byte array in this communicaion currently i'm using Readline that'll give the string. But i want to send some byte array to client and have to recieve one byte array.

 

Thanks in advance,

Babu.K

Developer
Apr 10, 2012 at 8:48 AM

The object returned by BluetoothClient.GetStream() is a NetworkStream which of course has Read and Write methods which take byte arrays -- don't use a StreamReader/Writer or event BinaryWriter if you want to use byte arrays.  See also the examples in the documetation http://32feet.codeplex.com/wikipage?title=General%20Bluetooth%20Data%20Connections