I try to send binary data to a RFCOM Bluetooth Module
from PC in VB6 I can write and read over SPP (COMx) and also the App Blueterm can send an receive binary data.
Binary data is mentioned as stream character bytes (values 0-255) including EOL (0x00) or CRLF (x13), which will be sent and can be received anytime in between the stream but the stream has never an CRLF at the end (the stream is not 'line' based)
The base of the tests is the serial example and the bluetooth example from this website.
Sub btnSend_Click
If connected Then
txtSend.Text = Chr(0x1b) & Chr(3)& Chr(0) & Chr(15) & Chr(16) & Chr(11) & Chr(45)
TextWriter1.Write(txtSend.Text)
TextWriter1.Flush
End If
End Sub
Sub Timer1_Tick
Dim c As String
If connected Then
If TextReader1.Ready Then 'check if there is any data waiting to be read
c = TextReader1.Readall 'read the buffer
End If
End If
End Sub
Serial Example:
When connected the application hangs up with the toastmessageshow connected information and no other information
Bluetooth Example:
Orignal code, after connecting -> Process was stoped unexpected.
from PC in VB6 I can write and read over SPP (COMx) and also the App Blueterm can send an receive binary data.
Binary data is mentioned as stream character bytes (values 0-255) including EOL (0x00) or CRLF (x13), which will be sent and can be received anytime in between the stream but the stream has never an CRLF at the end (the stream is not 'line' based)
The base of the tests is the serial example and the bluetooth example from this website.
Sub btnSend_Click
If connected Then
txtSend.Text = Chr(0x1b) & Chr(3)& Chr(0) & Chr(15) & Chr(16) & Chr(11) & Chr(45)
TextWriter1.Write(txtSend.Text)
TextWriter1.Flush
End If
End Sub
Sub Timer1_Tick
Dim c As String
If connected Then
If TextReader1.Ready Then 'check if there is any data waiting to be read
c = TextReader1.Readall 'read the buffer
End If
End If
End Sub
Serial Example:
When connected the application hangs up with the toastmessageshow connected information and no other information
Bluetooth Example:
Orignal code, after connecting -> Process was stoped unexpected.
Last edited: