Android Question Can vb6 talk to b4a through bluetooth?

Beja

Expert
Licensed User
Longtime User
This is an old question that didn't receive the right answer, and I thought to put it with example.
I have a BT module (HC-6) that works perfectly between Windows PC and microcontroller. In Windows
I use VB6 MSComm1.
I tried to interface Windows with my mobile device using the chat example.
Sending from mobile to Windows is perfect and no problem
The headache is from the PC to the Android device.

VB Example is very simple:
MSComm1. Output = Text1.Text

text1 contains "This is a test"
I receive in the device different values like: "a test", or "s is a test", but never get the whole sentence
"This is a test"
Any help is appreciated as I must use VB6 in the Windows side and not B4J at this time.

Thanks in advance.
p.s.
I know there is a limitation in astreams when interfacing to windows, but any tricks or workaoroud is
highly appreciated.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I know there is a limitation in astreams when interfacing to windows, but any tricks or workaoroud is
highly appreciated.
There is no limitation. It doesn't matter where the data come from. It can be a Windows machine a Bluetooth gadget or any other device that sends data.

I guess that you are talking about prefix mode. Prefix mode requires both sides of the connection to adhere to the "prefix protocol".


Without prefix mode you should not assume that the message will not be split or merged. This is how network communication works. You can use AsyncStreamsText class if the messages are separated with an end of line character.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Thanks Erel,
Can I understand that Windows is not supporting or adhere to prefix protocol?
please see the picture to know what kind of hardware I am using..
I am using the attached project As Is.. without modification. (just compiled and run it).
As mentioned: outgoing data received correctly on PC.. incoming causes hang for a long
time then a message saying "Serial example not responding"

for some reason not able to attach a picture
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Yes Erel, I did and didn't find info about this problem.. that's Windows->Android using HC-6 Bluetooth module.
The only response I get now also is "Connection is broken" (using Bluetooth example)
As I mentioned, the Android -> Windows is perfect, so I don't think the problem is in the protocol.
 
Upvote 0
Top