Android Question Stop waiting for...

Cenny

Active Member
Licensed User
Longtime User
Hi,

I have a bluetooth device that makes a scan.



B4X:
btGo_Click
    Wait For(StartScan) Complete (Result As Object)[
    ...


Sub StartScan As ResumableSub

    For i = StartAt To EndAt Step Stap
    
        Module1.SendTrimValue(i)
        servosetting=i
        lblServoSettings.Text=i
        Sleep(interval*1000)
                    
    Next
    
    Return Null
End Sub
The app is waiting for the scan to finish.
When the connection is broken, the app keeps waiting.
How can I stop the wait for?

Cenny
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

Cenny

Active Member
Licensed User
Longtime User
Erel, Thanks for the lesson.
It is not quit what I was looking for, but in the meantime I found a solution...

B4X:
btGo_Click
    Wait For(StartScan) Complete (Result As Object)
    
    If Result=Not(False) Then
    ...


Sub StartScan As ResumableSub

    For i = StartAt To EndAt Step Stap
    
        If Not(Main.bt_connected) Then
            MsgboxAsync(LastException.Message,"Oops...")
            Return False
        End If
    
        Module1.SendTrimValue(i)
        servosetting=i
        lblServoSettings.Text=i
        Sleep(interval*1000)
                    
    Next
    
    Return Null
End Sub
 
Upvote 0
Top