Sub AStream_NewData (Buffer() As Byte)
'Cirel sends 0xff handhsake before sending file
'We need to respond with 0xfe to acknowledge
If Buffer(0) = 0xFF Then
Log("FF received")
Dim tw As TextWriter
tw.Initialize(serial1.OutputStream)
tw.Write(Chr(0xFE))
tw.Flush 'to get the FE transmitted
Else
Log(Buffer(0) & "received")
End If
End Sub