Android Question Bluetooth to arduino (some questions)

newbie

Member
Licensed User
Longtime User
Hi,

i want to use AsyncStreams ro communicate with an arduino

when i set in the sub Serial_Connected
AStream.InitializePrefix(serial.InputStream,False,serial.OutputStream,"AStream")
the programm stopps


B4X:
Private Sub Serial_Connected (Success As Boolean)
   If Success Then
     
     If AStream.IsInitialized Then AStream.Close
     AStream.InitializePrefix(serial.InputStream,False,serial.OutputStream,"AStream")
   
     Log("Connected")
     connected = True
     
   Else
     Log(LastException)
   End If
   connecting = False
   CallSub(Main, "SetState")
End Sub

i don't now what is wrong

another question is:
how to watch permanently if the Bluetooth-connection is ok or not ??

thanks for hints
 
Top