• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Serial Comms question

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
G'Day all,
Environment
Windows NT, Java SDK 1.4.2_04, Comm API 2.0
Situation
I am trying to send string based commands to an external device and read in the returned data based off the command sent. The command string is delimited (LF), and is at least 9 chars in length, but it can go longer (length variable). Likewise, the returned data is delimitied (CRLF), and variable length.
Q1 - I'm not sure how best to compose the command to send, and get it to the outputstream's buffer.
Q2 - Is there a way to listen for the coms port receiving data? Or is it handled by the inputstream object?
Q3 - Is there an easy way to convert from a byte array to a string/stringbuffer?

I have been looking for examples, doco, websites, etc, and I have not had much luck - maybe I need to refine my Google skills a bit more
Thanking you in advance for your help,
Craig.
 
Craig Gaffney
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update
I have found a few examples that might have just answered my questions. I forgot that there were samples/demos that came with the Java Comm API.
Anyway, I am looking at them right now, and I'll see what wisdom I can gain.
Any insights, etc are still welcomed.

Once more, thanking you for your time, and understanding.
Craig.
reply
    Bookmark Topic Watch Topic
  • New Topic