Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mahmoud Hadad
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.
 
VReddy Parvathapu
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic