Android Tutorial Android Bluetooth / BluetoothAdmin Tutorial

Status
Not open for further replies.

terwelu

New Member
Licensed User
Longtime User
Have you tried to pair the device from Android bluetooth settings menu?

The passkey might be 1234 or any other value.
Hi Erel,

Yes, with other application, I can connect my Arduino with PC and my Galaxy Tab. The passkey is 0000 and it works for both connections.

Do you think I should try with ConnectInsecure option?

Cheers,
Ricki
 

terwelu

New Member
Licensed User
Longtime User
Hi Erel,

Forgive me for my limited knowledge of device communication :sign0013:, but what is SDP UUID?
And what is the easiest way to test if my device support that method?

Regards,
Ricki
 

ppgirl

Member
Licensed User
Longtime User
How can I handle bluetooth error

Hi Erel,

I make a program for bluetooth stream A/V with serial, It sends data realtime .

but , the connect will be error after moving my mobile sometimes, then raise "Sub AStream_Error" .


1.I try to close AStream and reopen , it looks like Serial1.InputStream/Outputstream is null

AStream.InitializePrefix(Serial1.InputStream, True, Serial1.OutputStream, "AStream")

2.I don't want to serial.connect , because it need a little time

3.How can I handle those error?

thank in advance!
 

ppgirl

Member
Licensed User
Longtime User
Other question


How can I detect "AsyncStreams" buffer status , byte count ,etc?
 

terwelu

New Member
Licensed User
Longtime User
Hi Erel,

I'll try to look for the documentation.
On the other hand, using another android bluetooth app and simple "Hyperterminal monitor", the communication is ok. It's just the app is not open source and moreover, I want to make my own bluetooth communication app with Basic for Android software.

Any other suggestions ?

Cheers,
Ricki
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
How can I detect "AsyncStreams" buffer status , byte count ,etc?
If you are using prefix mode then the event will be raised when there is a full message in the buffer. In standard mode there is no buffer. NewData is raised whenever there is data available.

@terwelu, you should try the other connection options. Also try to unpair the device and pair it again.
 

spcw1234

Member
Licensed User
Longtime User
For the life of me I can not figure out how to use prefix. I am using Pic Basic with a RN-42 bluetooth module. I can see the data fine with prefix disabled, but with prefix enabled it doesn't work. I am simply trying to output 1 byte right now.

Prefix1, prefix2, prefix3, prefix4, mybyte

I seem to be confused on what the prefix is, how to find it, and how to change it on the android app. I try to send a 1 with the following data but it doesn't work.

1,0,0,0,1

or

0,0,0,1,1

Any tips appreciated!
 

spcw1234

Member
Licensed User
Longtime User
That's the problem, from the other side no matter what I send serially the Android app crashes when I have prefix enabled. The prefix is 3 ascii zeros, correct?
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Is there a way to get raw data from any kind of device? Like say, a video game controller?
 

irda

Member
Licensed User
Longtime User
Ere, Terwelu, I have the same problem with a "Linvor" bluetooth module, I get the same error message, have you been able to find any solution?

I need to contact one of these modules and not how. Many thanks.


 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…