From: Juan P. F. G. <jfe...@gm...> - 2007-06-13 01:17:06
|
Hi all, just to share the solution to my problem... $rootexpect->exp_internal('2'); $rootexpect->expect($taim, "nnected"); $rootexpect->send("AT\015\012"); $rootexpect->expect($taim,"OK"); $rootexpect->send("ATDT 99999999\015\012"); my $x; $rootexpect->interact($x, 'XXX'); Now is dialing fine :) from: http://www.rocketaware.com/perl/perlfaq8/How_do_I_read_and_write_the_seri.htm end of line Some devices will be expecting a ``\r'' at the end of each line rather than a ``\n''. In some ports of perl, ``\r'' and ``\n'' are different from their usual (Unix) ASCII values of ``\012'' and ``\015''. You may have to give the numeric values you want directly, using octal (``\015''), hex (``0x0D''), or as a control-character specification (``\cM''). print DEV "atv1\012"; # wrong, for some devices print DEV "atv1\015"; # right, for some devices Even though with normal text files, a ``\n'' will do the trick, there is still no unified scheme for terminating a line that is portable between Unix, DOS/Win, and Macintosh, except to terminate ALL line ends with ``\015\012'', and strip what you don't need from the output. This applies especially to socket I/O and autoflushing, discussed next. |