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
A androidvh Member Licensed User Longtime User May 30, 2017 #3 dim as s string = "Test,Now,ON,1Hz" Upvote 0
DonManfred Expert Licensed User Longtime User May 30, 2017 #4 Hey Volker, did you tried something like Code: Dim os As OutputStream = ser_port.OutputStream Dim s As String = "Test,Now,ON,1Hz" os.WriteBytes(s.GetBytes("UTF8"),0,s.Length) PD: No need to create two identical threads Upvote 0
Hey Volker, did you tried something like Code: Dim os As OutputStream = ser_port.OutputStream Dim s As String = "Test,Now,ON,1Hz" os.WriteBytes(s.GetBytes("UTF8"),0,s.Length) PD: No need to create two identical threads
A androidvh Member Licensed User Longtime User May 31, 2017 #5 Dim s As String = "LOG,GEPOSE,ONTIME,1Hz" & CRLF Dim AStream As AsyncStreams AStream.InitializePrefix(Null, True, ser_port.OutputStream, "") AStream.Write(s.GetBytes("UTF8")) Upvote 0
Dim s As String = "LOG,GEPOSE,ONTIME,1Hz" & CRLF Dim AStream As AsyncStreams AStream.InitializePrefix(Null, True, ser_port.OutputStream, "") AStream.Write(s.GetBytes("UTF8"))
DonManfred Expert Licensed User Longtime User May 31, 2017 #6 Volker, please use CODE Tags when posting code! Upvote 0
DonManfred Expert Licensed User Longtime User May 31, 2017 #8 androidvh said: Post is solved... Click to expand... Really/Wirklich? Where/WO? Upvote 0
DonManfred Expert Licensed User Longtime User May 31, 2017 #10 androidvh said: #5 Click to expand... Forget to save the changes? Upvote 0