Android Question Getting started with BrainBox BL819 device (BLuetooth)

dara hayes

Member
Licensed User
Longtime User
Hello.
I have been struggling to get Bluetooth to work between my Android Asus ME173X device as it doesn't seem to allow inbound connections for some security reason , have been so far unable to work round this and my PC and so now I have purchased some dedicated BLuetooth Serial port devices , the ones I intend to use on my embedded system to replace the windows PC and serial connection , I have tried some of the B4A Bluetooth examples but they don't work as soon as I send data from the Brain-box device the link brakes , it doesn't work in the other direction but the link appears to stay on , It is perhaps because think the brain box device is not using ASync data streams , could some one please give some basic pointers as to how I can establish a simple SPP chat between my android device and the Brain-box BL819 device.
thanks , also how is it possible to send a known PIN at connection establishment , without having to ask the android user for a pin number to establish the link with the Brain box device which defaults to a pin of 1234 . thanks Dara
 
Make sure that AsyncStreams is not initialized in prefix mode. Prefix mode can only be used if both sides of the connection adhere to the "prefix" protocol.
I have set the code as follows .... FALSE inside the Initialized routine

If AStream.IsInitialized = False Then
AStream.InitializePrefix(Main.serial1.InputStream, False, Main.serial1.OutputStream, "AStream")
End If
I am connecting to my ASUS by USB cable and in the logs I see the correct mac address of the BrainBoxes Bluetooth device and It also says
connected:true the android program goes to Chat screen with text entry and send button , but no data transfers by keypad entry either from a phyiscal com port connected on a PC or into or out of the android device ,
I think I need to go back to basic SPP , I have not managed to get a single byte to transfer so far , confused , I have tried the serial example but it keeps giving me a bluetooth admin error , not sure how to get round any of these probelms ,
 
Upvote 0
apologies Erel I set it to use AStream.Initialize without Prefix mode just using input and output streams as below ....

AStream.Initialize(Main.serial1.InputStream,Main.serial1.InputStream,"AStream") but it still wont send data despite saying its connected to the
correct address of the device I want to communicate with, nothing on comport at other end
dara
 
Upvote 0
Erel
the code I am actually using is
AStream.Initialize(Main.serial1.InputStream,Main.serial1.OutputStream, "AStream")
typo on top posting ,
dara
 
Upvote 0
Sorry the code I am using is the code below

AStream.Initialize(Main.serial1.InputStream,Main.serial1.OutputStream, "AStream")

and the PC com port now sends ok a char at a time is received on the Android device , but android wont send to pc com port , is the Write function still ok ,its not writing in prefix mode so assume its ok to send this way or do i have to modify send code when not in prefix mode , I am now half way to communicating with Brainbox and Asus devices !
 
Upvote 0
No Erel unfortunately I have added a chr(10) and Chr(13) to my text inputs from the android device, but to no avail still only receives one char at a time on Android
nothing back to pc but now I have more serious issues raised in separate thread regarding the PATH of javac.exe and Android.jar raised 10th Dara
 
Upvote 0

Similar Threads

Back
Top