Sub Process_Globals
Public Serial1 As Serial
Public SerialCom As SoftwareSerial
Public AstreamCom As AsyncStreams
Public SerialCom2 As SoftwareSerial
Public AstreamCom2 As AsyncStreams
Private Rx1 As UInt = 03
Private Tx1 As UInt = 01
Private Rx2 As UInt = 00
Private Tx2 As UInt = 02
End Sub
Private Sub AppStart
Serial1.Initialize(2400)
Log("AppStart")
SerialCom.Initialize(2400,Tx1,Rx1)'Saida serial
AstreamCom.Initialize(SerialCom.Stream, "astreamCom1_NewData", Null)
SerialCom.Initialize(2400,Tx2,Rx2)'Saida serial
AstreamCom.Initialize(SerialCom.Stream, "astreamCom2_NewData", Null)
End Sub
Sub AstreamCom1_NewData (Buffer() As Byte)
Log("Received: ", Buffer)
End Sub
Sub AstreamCom2_NewData (Buffer() As Byte)
Log("Received: ", Buffer)
End Sub
Sub AStream_Error
'Log("Erro na comunicação com HC-12")
End Sub