Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

RXTX: getting the port identifier associated with the modem and using AT commands  RSS feed

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have established a connection with my internal modem using the RXTX API and have two questions about the RXTX API.to make a phone call from my computer through my internal modem i should be using AT commands so i must get an InputStream from a CommPort object and send the AT calling command through that InputStream and the modem should make the call?
this is the first question ,as for the second question how can my application determine on what port is the internal modem installed?i mean COM1,COM2...etc???i could not find a method for obtaining a port identifier associated with the hardware installed or the port my internal modem is attached to?
if anyone knows plzz advice as i'm totally new into this kind of programming.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
the CommPortIdentifier.getPortIdentifiers() method will return an enumeration of the ports available both serial and parallel . From this enumeration you need to cast each element to PortIdentifier(portId) and then call the method PortIdentifier.getName() this will return string of the name like in "COM1", "LPT1" etc. the COMx series is for serial ports and the LPTx series is for parallel ports. From then u could use the PortIdentifier to refer to your COM port, by creating a SerialPort object using open method ..like
eg: SerialPort comSerialPort = portId.open("someName",timeoutValue);

i hope this helps you.
 
Whatever you say buddy! And I believe this tiny ad too:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!