#Region Service Attributes
#StartAtBoot: True
#End Region
Sub Process_Globals
Dim inpkt(128) As Byte
Dim sout As OutputStream
Dim sinp As InputStream
Dim c, rxlen As Int
Dim s As String
End Sub
Sub Service_Create
sout = File.OpenOutput("","/dev/ttyS0",True)
sinp = File.OpenInput("","/dev/ttyS0")
End Sub
Sub Service_Start (StartingIntent As Intent)
rxlen = sinp.BytesAvailable
If rxlen > 0 Then
sinp.ReadBytes(inpkt,0,rxlen)
s = ""
For c = 0 To rxlen-1
s = s & Chr(inpkt(c))
Next
ToastMessageShow (s,True)
End If
End Sub
Sub Service_Destroy
End Sub