I am trying to send text via Hardware Serial port and getting nothing. Am I doing this wrong?
Thank you all in advance for the help!
Serial Text:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
'Ctrl+Click to open the C code folder: ide://run?File=%WINDIR%\System32\explorer.exe&Args=%PROJECT%\Objects\Src
Sub Process_Globals
Public Serial1 As Serial
'TXD1/RXD1 Serial for RYLR998
Private SerialNative1 As Stream 'https://www.b4x.com/android/forum/threads/additional-hardware-serial-ports.67150/
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
'Serial for RYLR998 connected to Hardware Serial Port 1.
RunNative("SerialNative1", Null)
Delay(2000)
Dim Buffer() As Byte = "AT+SEND=1,5,HELLO"
'AT+SEND=0,5,HELLO
Log("AppStart")
Log("Burrer = ",Buffer)
SerialNative1.WriteBytes(Buffer,0,Buffer.Length)
End Sub
#if C
void SerialNative1(B4R::Object* unused) {
::Serial1.begin(115200); //<--You can change the baud rate
b4r_main::_serialnative1->wrappedStream = &::Serial1;
}
#end if
Thank you all in advance for the help!