This project has moved. For the latest updates, please go here.

bluetooth chat desktop problem

Topics: Samples
Nov 13, 2012 at 5:07 AM


i want your help about this

i have application that communicate with android phone

when i send message from phone to

it receive one-time only  except once i reconnect to it and send again


i thought problem is in here

'form load

listening = True

Dim t1 As System.Threading.Thread
t1 = New Threading.Thread(AddressOf receiveLoop)
btClient = New BluetoothClient
Dim bdi As BluetoothDeviceInfo() = btClient.DiscoverDevices()
cboDevices.DataSource = bdi
cboDevices.DisplayMember = "DeviceName"

Public Sub receiveLoop()
Dim strReceived As String
btListener = New BluetoothListener(ServiceName)

strReceived = receiveMessage(MAX_MESSAGE_SIZE)
While listening '---keep on listening for new message
If strReceived <> "" Then
Me.Invoke(New EventHandler(AddressOf UpdateTextBox))

strReceived = receiveMessage(MAX_MESSAGE_SIZE)
End If
End While

End Sub

Nov 13, 2012 at 8:00 AM

The old BluetoothChat sample sends one message and then closes the connection. Have a look at the new BluetoothChat2 sample.

From the Readme:

  • Retired: BluetoothChat2 - Replaced by BluetoothChat2 — it doesn’t hang at start-up doing a discovery, and uses one connection between the pair of chat users to transfer the messages back and forth. Note: is not useful for testing general connections, use BluetoothSDP instead.

The BluetoothChat2 send/receives each messages on a newline (CR+LF as newline).

Nov 13, 2012 at 5:55 PM

thank you very much
i want to use old version because i can't understand c#
where can i edit the code is it what i posted upper ?
would you tell how can i edit to receive without close the connection

best regards

Nov 14, 2012 at 5:43 PM

thank you very much

i am using  serial port now

i think that's better way

good luck

Nov 16, 2012 at 9:32 AM

I've created a VB version of the Chat2 sample. Find it in the code respository here.

Nov 19, 2012 at 7:03 PM



             I do not see the link to your new exmaple. Can you please post it? Thanks.

Nov 26, 2012 at 8:04 PM

Go to and click Download you will find it in the Sample folder in the ZIP file. :-)