Hi
I use following code. It's OK in window7.
It always received 0 or -1 in the AStream_NewData when i run it use /dev/ttymxc2 in ubuntu. Why ???
jserial --> v1.05
I use following code. It's OK in window7.
It always received 0 or -1 in the AStream_NewData when i run it use /dev/ttymxc2 in ubuntu. Why ???
jserial --> v1.05
B4X:
private Sub OpenSerial(port As String,baudrate As Int)
sp.Open(port)
sp.Initialize("")
sp.SetParams(baudrate,8,1,0)
'sp.SetPort(port,baudrate,2)
AStream.Initialize(sp.GetInputStream, sp.GetOutputStream, "AStream")
pgConnected = True
Queue.Clear
'
t2.Reset
Timer1.Enabled=True
End Sub
'
private Sub AStream_NewData(buffer() As Byte)
Dim n1 As Int=buffer.Length
Dim bc As ByteConverter
bc.ArrayCopy(buffer,0,Rxb.Data,Rxb.Count,n1)
Rxb.Count=Rxb.Count+n1
End Sub
'