i using wemos mini hardware serial to receive data from another device, i can't receive any data.
Above is my testing code, which part make the problem?
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public LogSerial As Serial
Private SerialNative1 As Stream
Private astreamData As AsyncStreams
Dim bc As ByteConverter
End Sub
B4X:
Private Sub AppStart
LogSerial.Initialize(115200)
RunNative("SerialNative1", Null)
astreamData.Initialize(SerialNative1,"astreamData_NewData", Null)
Log("AppStart")
End Sub
B4X:
Sub astreamData_NewData (buffer() As Byte)
Log(bc.HexFromBytes(buffer))
End Sub
B4X:
#IF C
void SerialNative1(B4R::Object* unused) {
::Serial1.begin(9600,SERIAL_8N2);
b4r_main::_serialnative1->wrappedStream = &::Serial1;
}
#END IF
Above is my testing code, which part make the problem?