BT example problem

sonra

Member
Licensed User
Longtime User
Hello
I try to use the example to connect my TF700 to lego NXT2 controller
when i run I goto a option to connect amd it open the ChatActivity form
but when i press on the "Send " button i receive an error on
Sub AStream_Error
'ToastMessageShow("Connection is broken.", True)
ToastMessageShow(LastException.Message, True)
btnSend.Enabled = False
txtInput.Enabled = False
End Sub
( I changed the original code to see the error "
and it is "java.io exception error bt socket closed and return -1"
I use to connect.connet2
Any help
the log

Installing file.
PackageAdded: package:anywheresoftware.b4a.samples.bluetooth
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
NXT:00:16:53:10:26:E1
connected: true
** Activity (main) Pause, UserClosed = false **
** Activity (chatactivity) Create, isFirst = true **
** Activity (chatactivity) Resume **
** Activity (chatactivity) Pause, UserClosed = true **
** Activity (main) Resume **
NXT:00:16:53:10:26:E1


Doron:sign0085:
 

sonra

Member
Licensed User
Longtime User
a

Hi Erel
I use this part of software as is in example
Is it OK ??

"Sub Activity_Create(FirstTime As Boolean)

Activity.LoadLayout("2")
If AStream.IsInitialized = False Then
AStream.InitializePrefix(Main.serial1.InputStream, True, Main.serial1.OutputStream, "AStream")
End If
txtLog.Width = 100%x
End Sub"
Doron
 
Upvote 0
Top