A androidvh Member Licensed User Longtime User May 30, 2017 #1 open port (Bluetooth) with: ser_port.connect(PairedDevices.GetValueAt(myDev)) -> Data is coming in, works perfect Now I want to write a string (dim as string = "Test,Now,ON,1Hz") to the device: doesn't work with: Sub ser_port_Connected (Success As Boolean) ' If Success Then Dim txt_wr As TextWriter txt_wr.Initialize(ser_port.OutputStream) txt_wr.Write(s) -> doesn't work txt_rd.Initialize(ser_port.InputStream) -> works perfect what is to do??? kind regards Volker
open port (Bluetooth) with: ser_port.connect(PairedDevices.GetValueAt(myDev)) -> Data is coming in, works perfect Now I want to write a string (dim as string = "Test,Now,ON,1Hz") to the device: doesn't work with: Sub ser_port_Connected (Success As Boolean) ' If Success Then Dim txt_wr As TextWriter txt_wr.Initialize(ser_port.OutputStream) txt_wr.Write(s) -> doesn't work txt_rd.Initialize(ser_port.InputStream) -> works perfect what is to do??? kind regards Volker
Erel B4X founder Staff member Licensed User Longtime User May 31, 2017 #2 You should never use TextReader / TextWriter with network or Bluetooth connections. Use AsyncStreams. You can use AsyncStreamsText for text based communication. Upvote 0
You should never use TextReader / TextWriter with network or Bluetooth connections. Use AsyncStreams. You can use AsyncStreamsText for text based communication.