Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

outputstream.write(byte[]) issues  RSS feed

 
Mike Southgate
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem writing to my serial port some of the time. It works like a charm many times and then seems to just freeze up completely. It doesn't throw any exceptions, but the code seems to block on that line indefinitely.
I've tried many things to get around this: closed and re-opened the outputstream, checked for other serial port events, etc.

the code:


I see the output from the first println but not the second. I've replaced the method call with a simple byte[] and it does the same thing. Only one thing seems different from the myriad previous times it works - that is that this time it follows a method that puts the thread to sleep for about 10 seconds while it waits for the data coming in the serial port to all arrive.
Could that make a difference?

ms
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!