File: telem-unit.pl

package info (click to toggle)
direwolf 1.6%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,720 kB
  • sloc: ansic: 53,861; perl: 170; cpp: 124; sh: 113; makefile: 41; python: 11
file content (27 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

# Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015

if ($#ARGV+1 < 2 || $#ARGV+1 > 14) { 
	print STDERR "A callsign and 1 to 13 units/labels must be provided.\n";
	usage(); 
}

# Separate out call and pad to 9 characters.
$call = shift @ARGV;
$call = substr($call . "         ", 0, 9);
	
print ":$call:UNIT." . join (',', @ARGV) . "\n";
exit 0;

sub usage () 
{
	print STDERR "\n";
	print STDERR "telem-unit.pl - Generate UNIT message with channel units/labels.\n";
	print STDERR "\n";
	print STDERR "Usage:  telem-unit.pl  call unit1 ... unit5 label1 .,, label8\n";
	print STDERR "\n";
	print STDERR "Specify a callsign and up to 13 names for the units/labels.\n";

	exit 1;
}