Public Sub handlebgcmd
If CMDLISTS.Size > 0 Then
For i = 0 To CMDLISTS.Size - 1
Handlcmdstrings(CMDLISTS.Get(i))
Sleep(0)
Next
CMDLISTS.Clear
End If
isbackground = False
End Sub
Public Sub Handlcmdstrings(CMDS As String)
Dim paramnum() As String
paramnum = Regex.Split("\&", CMDS)
If paramnum(0) = "ver" Then
Log(paramnum(1))
Else If paramnum(0) = "connected" Then
CallSub2(Main,"Displayconnect",paramnum(1))
End If
End Sub
Public Sub NEWDATA(data() As Byte)
Dim arrvmsg As String
arrvmsg = BytesToString(data, 0, data.Length, "UTF-8")
arrvmsg = arrvmsg.Trim
If arrvmsg.Length = 0 Then
Log("Error")
Return
End If
If isbackground = True Then
CMDLISTS.Add(arrvmsg)
Return
End If
Handlcmdstrings(arrvmsg)
End Sub