Android Question [SOLVED] Bluetooth connecting problem

rosippc64a

Active Member
Licensed User
Longtime User
Hello Everyone!
I had a working app. The idea is to send data between three devices.
Windows PC (USB BT500 BT device) <-> Feitian F20 Android PDA (BT 4.2)<-> Android PC (BT 4.0).
So the android PDA is connected either to the PC or to the ANDROID PC.

Here comes the problem.
Then I changed (I had to) the Feitian F20 to N40L PDA (BT 4.0).
I tried first Windows PC <-> N40L PDA. The PDA try to connect to Windows PC. There is a B4J app.

The B4J app indicates that the connection was successful. The PDA (B4A) detects nothing of this and after a timeout, the PDA app finish waiting for connection.
I try to send a photo from the PDA to Windows and that was OK. So The PDA BT good.

Based on the fact that the program has been proven on other PDAs, do you have any idea where to look for a bug?

Thanks in advance
Steven
 

rosippc64a

Active Member
Licensed User
Longtime User
I will try
I installed a bluetooth chat example and that works well. So in my code there is something...
 
Upvote 0

rosippc64a

Active Member
Licensed User
Longtime User
The solution (My sin, my very great sin):
The BT stuff resides in a class.
Here I connect:
BTConnection.Connect(lMacAddress) 'convert the name to mac address and connect

and I wait for the result in a
sub Serial1_connected(...)
but it fires NEVER.
My modification:
BTConnection.Connect(lMacAddress) 'convert the name to mac address and connect
wait for Serial1_Connected (Success As Boolean)
If Success Then
...
and everything is perfect...
My stupid...
 
Upvote 0

rosippc64a

Active Member
Licensed User
Longtime User
No, it was just an early joy. The real solution is that even though BT is in class, the connected event must be implemented in the activity that owns it.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…