Send Carriage return

Send Carriage return

am 17.09.2007 04:01:26 von 280SEL

Hello:

I hope that someone can set me on the right track with this:

I am trying to establish a Heartbeat with a remote machine using Perl.
I am sending a string like so:

print $socket "$output";

In order to keep the line open, the remote machine wants a carriage
return at the end (HEX 0D).

I have tried the perl \n, I have tried all kinds of ways , including:

$output=$string.hex'0D';
print $socket "$output";

This, of course, translates the hex carriage return into Decimal 13
and sends that number which doesn't help.

Does anybody know how to do this?

Any help would be greatly appreciated!

Re: Send Carriage return

am 17.09.2007 04:26:28 von paduille.4061.mumia.w+nospam

On 09/16/2007 09:01 PM, 280SEL wrote:
> [...]
> In order to keep the line open, the remote machine wants a carriage
> return at the end (HEX 0D).
> [...]

print $socket "$output\x0D";

Re: Send Carriage return

am 19.09.2007 01:05:56 von Neil Cherry

On Mon, 17 Sep 2007 02:01:26 -0000, 280SEL wrote:
> Hello:
>
> I hope that someone can set me on the right track with this:
>
> I am trying to establish a Heartbeat with a remote machine using Perl.
> I am sending a string like so:
>
> print $socket "$output";
>
> In order to keep the line open, the remote machine wants a carriage
> return at the end (HEX 0D).
>
> I have tried the perl \n, I have tried all kinds of ways , including:
>
> $output=$string.hex'0D';
> print $socket "$output";
>
> This, of course, translates the hex carriage return into Decimal 13
> and sends that number which doesn't help.
>
> Does anybody know how to do this?
>
> Any help would be greatly appreciated!
>

To send a 0x0D try using \r

Also it is common for network communications to use \r\n as the line
ending. You may not need it but it's a thought.

--
Linux Home Automation Neil Cherry ncherry@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
Author of: Linux Smart Homes For Dummies