B4R Question AppStart Endless Loop?

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

when running this example using B4R BETA 9, the log shows an endless loop logging "appstart - appstart completed".
Any idea what is wrong in the code?

B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Public AStream As AsyncStreams
    Public StreamS As Stream
    Private timer1 As Timer
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    AStream.Initialize(StreamS, "AStream_NewData", Null)
    timer1.Initialize("Timer1_Tick", 2000)
    timer1.Enabled = True
    Log("AppStart Completed")
End Sub

Sub Timer1_Tick
    AStream_WriteData
    timer1.Enabled = False
    Log("AppStop")
End Sub

Sub AStream_WriteData
    Log("AStream_WriteData")
    AStream.Write("Hello World".GetBytes)
End Sub

Sub AStream_NewData(Buffer() As Byte)
    'NOT USED
End Sub
 
Top