Closed NeedNot closed 7 months ago
opening multiple connections is explained here
I'm not trying to connect to the same device at once, When I call the function it should open the port that was passed, read a line then close the connection. I'm not sure if the connection is being closed but what I do know is opening a different port doesn't read from that new port.
here is what I mean, the first time you click on something it shows an output from the last port that was connected, click it again then it shows something from the last device, sooo....
if you had 3 ports click on port 1 get data from port 1, click on port 2 get data from port 1, click on port 3 get data from port 2, click on port 3 again get data from port 3, click on any other port and get data from port 3, click on any port and get data from port the one you just clicked
I get the whole thing about connecting to multiple ports but I dont see why I would have a problem
do I need to make a connection differently?
UsbDeviceConnection connection = manager.openDevice(serialPort.getDevice());
please delete this I am an idiot. I fixed it
I'm trying to simply test a serialPort to check if it's outputting the desired data (there are different ports for different data on this device)
However, I'm not having luck making it work. If I test port 1 it's good, then if I test port 2 it will get data from port 1? but then it's reset so if I test port 2 again it's the correct data. this is repeated for everything. first time it works, second time outputs from the same device as before, 3rd time is back to the first time behavior.
I played around with my code a bit and now it only outputs from the same port
If i had to guess perhaps the connection isn't closing?
not sure if this is related but i get that everytime i try to run the code
Also it appears like i should be using custom listeners so that when I read the data is new. any idea how to read ONLY the newest COMPLETE line? this is for something else but i'll need to read the data in realtime