#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
Private stream1 As AsyncStreams
Private SerialNative1 As Stream
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
RunNative("SerialNative1", Null)
stream1.Initialize(SerialNative1, "VDRIVE_NewData", Null)
SendData
End Sub
Sub SendData
' stream1.Write("DIR".GetBytes)
' stream1.Write(Array As Byte(13))
End Sub
Sub VDRIVE_NewData (Buffer() As Byte)
Log("Received from VDRIVE: -------------")
Log(Buffer)
Log("----------------------------------")
End Sub
#if C
void SerialNative1(B4R::Object* unused) {
::Serial1.begin(9600);
b4r_main::_serialnative1->wrappedStream = &::Serial1;
}
#end if