I am setting up the port to receive 8 data bits. But the data is garbled unless I set the B4j program port to 7 data bits. If I send data from the B4J program with 8 data bits it is received properly. Am I setting the port wrong?
Private Sub btnOpen_Click
If lblStatus.Text = "Closed" Then
sp.Open(Port)
sp.SetParams(9600,8,1,0)
'sp.SetParams(BaudRate,DataBits,Parity,StopBits)
astream.Initialize(sp.GetInputStream, sp.GetOutputStream, "astream")
lblStatus.Text = "Open"
btnOpen.Text = "Close"
taSend.Text = DataBits
Else
sp.Close
lblStatus.Text = "Closed"
btnOpen.Text = "Open"
End If
End Sub
Private Sub btnOpen_Click
If lblStatus.Text = "Closed" Then
sp.Open(Port)
sp.SetParams(9600,8,1,0)
'sp.SetParams(BaudRate,DataBits,Parity,StopBits)
astream.Initialize(sp.GetInputStream, sp.GetOutputStream, "astream")
lblStatus.Text = "Open"
btnOpen.Text = "Close"
taSend.Text = DataBits
Else
sp.Close
lblStatus.Text = "Closed"
btnOpen.Text = "Open"
End If
End Sub