#!/usr/bin/perl use Socket; if ($ARGV[0] eq "") { print "$0 -e 0 Reset to default values\n"; print "$0 -e 2 Set keying speed (5 ... 60 wpm)\n"; print "$0 -e 3 Set sidetone (300 ... 1000 Hz)\n"; print "$0 -e 30 Sound off\n"; print "$0 -e 4 Abort message\n"; print "$0 -e 5 Stop (Exit) the daemon\n"; print "$0 -e 6 Set uninterruptable (word- ) mode for simulator\n"; print "$0 Any message Send morse code message (max 1 packet!)\n"; print "$0 qrz de foo ++test-- In- and decrease speed on the fly in 5 wpm steps\n"; exit(1); } if ($ARGV[0] eq "-e") { $msg = "\e" . $ARGV[1] . "\0"; } else { $msg = "@ARGV" . "\0"; } socket (SOCKET, PF_INET, SOCK_DGRAM, getprotobyname("udp")) or die "socket $!"; $ipaddr = inet_aton("localhost"); $portaddr = sockaddr_in(6789, $ipaddr); send(SOCKET, $msg, 0, $portaddr); exit(0);