marco.canta Active Member Licensed User Longtime User Mar 24, 2016 #1 Hello, I'm using the Serial library to write and read data from USB / Serial. I have the need to read the data (input buffer) only in certain procedures of the program and not through "Astreams_NewData Event". Example : Astream.write ("Hello") InData = (buffer value in serial) Astream.write ("Date Recive") It can be done ? as ? Thanks Marco.
Hello, I'm using the Serial library to write and read data from USB / Serial. I have the need to read the data (input buffer) only in certain procedures of the program and not through "Astreams_NewData Event". Example : Astream.write ("Hello") InData = (buffer value in serial) Astream.write ("Date Recive") It can be done ? as ? Thanks Marco.
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2016 #2 It is not possible with AsyncStreams. One possible example: Code: Copy Astream.write ("Hello") NextSubName = "DataReceiveSub" End Sub Sub DataReceiveSub (Data() As Byte) Astream.write ("Date Recive") NextSubName = ... End Sub Sub ASTream_NewData(...) CallSub2(NextSubName, Data) End Sub Upvote 0
It is not possible with AsyncStreams. One possible example: Code: Copy Astream.write ("Hello") NextSubName = "DataReceiveSub" End Sub Sub DataReceiveSub (Data() As Byte) Astream.write ("Date Recive") NextSubName = ... End Sub Sub ASTream_NewData(...) CallSub2(NextSubName, Data) End Sub