Sub Class_Globals
Private bc As ByteConverter
Public SerialPort As UART ' Library by Rui Cardoso: https://www.b4x.com/android/forum/threads/gpio-and-uart.100811/#content
Dim SerialPort_devPath As String = "/dev/tty1WK3"
Dim SerialPort_eventName As String = "SerialPort"
Dim SerialPort_baudeRate As Int = 9600
Dim SerialPort_flags As Int = 0
Dim bigEndian As Boolean = False
Dim prefix As Boolean = False
End Sub
Public Sub Initialize
Try
SerialPort.Initialize(SerialPort_eventName, SerialPort_devPath, SerialPort_baudeRate, SerialPort_flags, bigEndian, prefix)
Catch
LogColor("###################################################", Colors.Red)
LogColor("# >>>>>>>>>>>>> CRASH PORTA SERIALE <<<<<<<<<<<<< #", Colors.Red)
LogColor("###################################################", Colors.Red)
Log(LastException)
End Try
End Sub
Private Sub SerialPort_NewData (Buffer() As Byte)
'Do something with the data in the Buffer
End Sub