Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Hyperterminal and java communication to Serial port COM1

Reply
Thread Tools

Hyperterminal and java communication to Serial port COM1

 
 
lrantisi
Guest
Posts: n/a
 
      02-15-2007
I use the hyperterminal to communicate and send commands to serial
port COM1.
On the hyperterminal window, I used to type such a command:

AT+ZV SPPCONNECT.......

This command is sent to the device connected to the COM1 port.

Now I want to cancel the hyperterminal, and sue a Java program.
I used the javax.comm library to build a java application that
communicates with the COM1 port.

Inside that program, I connected to the COM1 port. How do I send that
text command from inside the java program to the COM1 port. There is a
method called (send) inside the (serialport) class, do I just say:

serialport.send "AT+ZV SPPCONNECT.......".

I mean, is sending text commands through the hyperterminal simply
equivalent to sending those text commands to the COM1 port using the
java application described above.

Now: Is sending the text command to the COM1

 
Reply With Quote
 
 
 
 
Thomas Fritsch
Guest
Posts: n/a
 
      02-15-2007
lrantisi wrote:
> I use the hyperterminal to communicate and send commands to serial
> port COM1.
> On the hyperterminal window, I used to type such a command:
>
> AT+ZV SPPCONNECT.......
>
> This command is sent to the device connected to the COM1 port.

It seems you are referring to the examples given at
<http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html>,
don't you?
>
> Now I want to cancel the hyperterminal, and sue a Java program.
> I used the javax.comm library to build a java application that
> communicates with the COM1 port.
>
> Inside that program, I connected to the COM1 port. How do I send that
> text command from inside the java program to the COM1 port. There is a
> method called (send) inside the (serialport) class, do I just say:
>
> serialport.send "AT+ZV SPPCONNECT.......".

This is not even syntactically correct (hence I assume you are still a
very beginner in Java). It will be probably more like
OutputStream outputStream = serialPort.getOutputStream();
outputStream.write("AT+ZV SPPCONNECT.......".getBytes());
outputStream.flush();
>
> I mean, is sending text commands through the hyperterminal simply
> equivalent to sending those text commands to the COM1 port using the
> java application described above.

I suppose so (although I have no practical experience with javax.comm).
But using javax.comm is not only about sending bytes. It is also about
waiting for responses (and that is probably the more difficult part).
>
> Now: Is sending the text command to the COM1
>

Be warned: Before you will have any chance for mastering the javax.comm
package, there is much work for you to prepare the basics:
(1) Learn the Java language (the syntax and concepts)
(2) Learn the basic Java classes (like OutputStream)
(3) Read the API docs at
http://java.sun.com/products/javacom...api/index.html

--
Thomas
 
Reply With Quote
 
 
 
 
ashishkhadpe ashishkhadpe is offline
Junior Member
Join Date: Apr 2011
Posts: 1
 
      04-15-2011
Quote:
Originally Posted by Thomas Fritsch View Post
lrantisi wrote:
> I use the hyperterminal to communicate and send commands to serial
> port COM1.
> On the hyperterminal window, I used to type such a command:
>
> AT+ZV SPPCONNECT.......
>
> This command is sent to the device connected to the COM1 port.

It seems you are referring to the examples given at
<http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html>,
don't you?
>
> Now I want to cancel the hyperterminal, and sue a Java program.
> I used the javax.comm library to build a java application that
> communicates with the COM1 port.
>
> Inside that program, I connected to the COM1 port. How do I send that
> text command from inside the java program to the COM1 port. There is a
> method called (send) inside the (serialport) class, do I just say:
>
> serialport.send "AT+ZV SPPCONNECT.......".

This is not even syntactically correct (hence I assume you are still a
very beginner in Java). It will be probably more like
OutputStream outputStream = serialPort.getOutputStream();
outputStream.write("AT+ZV SPPCONNECT.......".getBytes());
outputStream.flush();
>
> I mean, is sending text commands through the hyperterminal simply
> equivalent to sending those text commands to the COM1 port using the
> java application described above.

I suppose so (although I have no practical experience with javax.comm).
But using javax.comm is not only about sending bytes. It is also about
waiting for responses (and that is probably the more difficult part).
>
> Now: Is sending the text command to the COM1
>

Be warned: Before you will have any chance for mastering the javax.comm
package, there is much work for you to prepare the basics:
(1) Learn the Java language (the syntax and concepts)
(2) Learn the basic Java classes (like OutputStream)
(3) Read the API docs at
http://java.sun.com/products/javacom...api/index.html

--
Thomas
I am doin 1 project on "langauge translation on mobile phones". i want to transfer the conversation goin on btwn 2 people to PC either using GSM(i.e. COM port) or using Bluetooth how i can do ths??
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open/write and read serial port (COM1) on iPAQ 2210 Shadowdancer ASP .Net Mobile 1 09-21-2004 08:12 PM
Borland C++ Serial Port communication Andreas Horneff C++ 1 08-15-2004 08:15 PM
serial port communication in C++ MFC fdunne2 C++ 2 06-30-2004 09:13 PM
Serial Port communication Bernhard Voigt Java 1 10-27-2003 05:35 PM
Can't connect to serial port with hyperterminal David Computer Support 2 07-13-2003 08:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57