By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Sending contol-z (^z) over serial interface

P: n/a
Hi,
I am working with a simple Java program which communicates over the
serial port with a GSM modem.
Using Hypertermial, I can send messages and need to press control-z to
process the messages. I have created a PrintStream over the serial
port, but I do not know how to send control-z from the program!

I fin in another Google- thread that control-c equals decimal 3:
But what is then the equivalent of control-z, and how should it be
transmitted? Could I do:
myPrintStream.write(4);
if dec 4 would be the equivalent of control-z?

Hope somebody can help me! :-)

Regards, Per Magnus
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
nos
I think control z is decimal 26

"Per Magnus L?vold" <pm******@broadpark.no> wrote in message
news:a0**************************@posting.google.c om...
Hi,
I am working with a simple Java program which communicates over the
serial port with a GSM modem.
Using Hypertermial, I can send messages and need to press control-z to
process the messages. I have created a PrintStream over the serial
port, but I do not know how to send control-z from the program!

I fin in another Google- thread that control-c equals decimal 3:
But what is then the equivalent of control-z, and how should it be
transmitted? Could I do:
myPrintStream.write(4);
if dec 4 would be the equivalent of control-z?

Hope somebody can help me! :-)

Regards, Per Magnus

Jul 17 '05 #2

P: n/a
Thank you, I'll try that later today!
But how can you tell?
I thought of the KeyEvent.CONTROL value, but that doesn't seem to
work. And it seems as if control-c and control-z is represented as one
single character.
I would like to understand this. :-)

Regards,
Per Magnus

"nos" <no*@nospam.com> wrote in message news:<eyM1c.179228$uV3.758524@attbi_s51>...
I think control z is decimal 26

"Per Magnus L?vold" <pm******@broadpark.no> wrote in message
news:a0**************************@posting.google.c om...
Hi,
I am working with a simple Java program which communicates over the
serial port with a GSM modem.
Using Hypertermial, I can send messages and need to press control-z to
process the messages. I have created a PrintStream over the serial
port, but I do not know how to send control-z from the program!

I fin in another Google- thread that control-c equals decimal 3:
But what is then the equivalent of control-z, and how should it be
transmitted? Could I do:
myPrintStream.write(4);
if dec 4 would be the equivalent of control-z?

Hope somebody can help me! :-)

Regards, Per Magnus

Jul 17 '05 #3

P: n/a
When you press Ctrl - A in Hyperterminal, an ASCII 1 is sent out the
serial port. When you Hit Ctrl - B, an ASCII 2 is sent. When you Hit
Ctrl - C, an ASCII 3 is sent and so on...
In other words, the position in the alphabet for the letter determines
the character that gets sent.
Since Z is the 26th letter in the alphabet, Ctrl - Z represents an
ASCII 26 therefore you need to transmit an ASCII 26.
On 4 Mar 2004 07:24:58 -0800, pm******@broadpark.no (Per Magnus
L?vold) wrote:
Hi,
I am working with a simple Java program which communicates over the
serial port with a GSM modem.
Using Hypertermial, I can send messages and need to press control-z to
process the messages. I have created a PrintStream over the serial
port, but I do not know how to send control-z from the program!

I fin in another Google- thread that control-c equals decimal 3:
But what is then the equivalent of control-z, and how should it be
transmitted? Could I do:
myPrintStream.write(4);
if dec 4 would be the equivalent of control-z?

Hope somebody can help me! :-)

Regards, Per Magnus


Jul 17 '05 #4

P: n/a
Why are you still using such unhandy thing as Hyper Terminal? Recently
I've found an interesting program - Flash Terminal. It is really Hyper
Terminal killer. With Flash Terminal you can chat and exchange files
via modem (including v.90, ISDN, ADSL, GPRS) and null-modem
simultaneously without Internet! You can exchange up to 255 files at
once with unlimited transfer resuming after connection break. Program
includes large amount of nice avatars.
Direct link for downloading:
http://www.qwertystudios.com/FlashTerminalSetup.zip
Direct link for Win95 version downloading:
http://www.qwertystudios.com/FlashTerminalSetup_w95.zip
Developers site:
http://www.qwertystudios.com/
More info:
http://www.qwertystudios.com/products.php.html
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.