Order Tray | Contact Us | Home | SIG Lists

[aprssig] telnet client

Jason Winningham jdw at eng.uah.edu
Sat Mar 31 22:08:02 UTC 2007


On Mar 31, 2007, at 2:06 PM, Wes Johnston, AI4PX wrote:

> Does anyone know of a telnet client for win32 that can be commanded  
> from a command line to send a text file upon connecting to a  
> server?  The application is to allow a program I've written to  
> create some info on some aprs objects, then make a telnet program  
> connect to the aprs IS (or local server copy of aprs) and send the  
> data line by line.  It would then disconnect and return to the  
> command prompt.
>
> Any ideas?

Windows had a telnet client; not sure how scriptable/controllable it is.

It may not be too difficult to make your program create a TCP socket  
and do it inline, but I don't do windows programming so I can't give  
any advice.

Sounds like you really want a perl script. (:  I've used  
ActiveState's version of perl, and a quick check indicates it comes  
with IO::Socket::INET, so you don't have any extras to load.  The  
example code below creates a DF object and changes the bearing to the  
target a few times; maybe it's good enough to be of some use.

-Jason
kg4wsv


#!/usr/bin/perl

use IO::Socket::INET;

$socket = IO::Socket::INET->new("localhost:2023")
     or die "could not connect to server!";


$mycall="KG4WSV-14";
$dest="APRS";
$object_name="df-test5";
$create_del = "*";

print STDOUT "user $mycall pass 12345 vers fubar 0.0.0a\n";
print $socket "user $mycall pass 12345 vers fubar 0.0.0a\n";

for ($i=0; $i<=360; $i += 15)
{
     $t = time();
     $s = $t % 60;
     $t /= 60;
     $m = $t % 60;
     $t /= 60;
     $h = $t % 24;

     $format = "%s>%s:;%-9.9s%1.1s%02.2d%02.2d%02.2dz3435.00N/ 
08711.00W\\000/000/%03d/969 \n";

     printf STDOUT $format, $mycall, $dest, $object_name,  
$create_del, $h, $m, $s, $i;
     printf $socket $format, $mycall, $dest, $object_name,  
$create_del, $h, $m, $s, $i;
     sleep 10;
}

sleep 20;

$create_del = "_";

printf STDOUT $format, $mycall, $dest, $object_name, $create_del, $h,  
$m, $s, $i;
printf $socket $format, $mycall, $dest, $object_name, $create_del,  
$h, $m, $s, $i;

close($socket);





More information about the aprssig mailing list