<!--
programmer		comments for file contents
status 			comments for file contents

TITLE			title bar text, max 30 characters
rig				id of transceiver idribed by this file

port			serial port assigned to control this rig
baud			numeric baud rate
device			Linux device absolute path idriptor
echo			yes / no, cpu-to-rig comms echo back via h/w or s/w typical of CI-V id of rig-rig-cpu network
retries			number of retries before failure returned
timeout			milliseconds between retries
wait			milliseconds between commands

command			command to send
command/@id		id of command (PTTON, PTTOFF, SETFREQ, GETFREQ, etc.)
sequence		command sequence for specified command
byte			hex reBYTEsentation of byte be sent formatted raw
bcd				data to be sent formatted BCD
string			data to be sent literally
binary-big		?
binary-little		?
boolean			?
DATA			data field

SIZE			# bytes in data field, 0 = NOT FIXED
MAX				maximum expected value
MIN				minimum expected value
RESOL			resolution, ie: 1, 10, 100 etc.
ORDER			NORM = Most Significant Digit first
				REV	 = Lease Significant Digit first
BYTE			BYTE-amble sequence if required
REPLYS			space delimited list of one or more REPLY

REPLY sequence sent by the rig to a specific command or query issued by the computer.
REPLY			transceiver REPLY
id				id of REPLY OK, BAD, FREQ, MODE etc
DATA			data field
Children:		BINARY-BIG, BINARY-LITTLE, BCD, BOOLEAN, STRING
SIZE			# bytes in data field, absent = NOT FIXED
MAX				maximum expected value
MIN				minimum expected value
-->

<RIGDEF>

<RIG>Yaesu 817</RIG>

<PROGRAMMER>
	Written by:		Dave Freese, W1HKJ
	Tested by:		Mike Heim, KD0AR
</PROGRAMMER>

<STATUS>
	Verified
</STATUS>

<TITLE>Rig Control - FT-817</TITLE>

<!-- Instructions for setting up the port
	BAUD     normal baud rate that transceiver operates at for CAT
	DEVICE   full path to the serial device
	ECHO     set to true for CI-V type of interface in which a h/w loop back sends all
	         outgoing data from Tx to Rx, or if the transceiver echos the data stream
	RETRIES  # times that the computer tries to send a command sequence before failure
	TIMEOUT  time in milliseconds between retries
	WAIT     time to wait between successive transmissions
	DTRINIT  inititialized state of the DTR pin, +/- 12 are valid entries.  This is the 
	         voltage level that will be available at the DTR pin.  For some CI-V type of 
	         interfaces this voltage may be used to power the serial converter
	DTRPTT   logic true or false designating whether the DTR pin is used for PTT.
	         PTT ON will toggle the DTRINIT state, ie: if +12 it goes to -12, if -12 it
	         changes to +12.
	RTSINIT  inititialized state of the RTS pin, same as for DTR
	RTSPTT   specifies whether the RTS pin is used for PTT, same logic as with DTR.
-->

<PORT>
	<BAUD>4800</BAUD>
	<DEVICE>/dev/ttyUSB0</DEVICE>
	<ECHO>false</ECHO>
	<RETRIES>4</RETRIES>
	<TIMEOUT>200</TIMEOUT>
	<WAIT>50</WAIT>
	<DTRINIT>-12</DTRINIT>
	<DTRPTT>false</DTRPTT>
	<RTSINIT>-12</RTSINIT>
	<RTSPTT>false</RTSPTT>
</PORT>

<MODES>
	<ELEMENT>
		<SYMBOL>LSB</SYMBOL>
		<BYTE>00</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>USB</SYMBOL>
		<BYTE>01</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>CW</SYMBOL>
		<BYTE>02</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>CW-R</SYMBOL>
		<BYTE>03</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>AM</SYMBOL>
		<BYTE>04</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>FM</SYMBOL>
		<BYTE>08</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>FM-N</SYMBOL>
		<BYTE>88</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>DIG</SYMBOL>
		<BYTE>0A</BYTE>
	</ELEMENT>
	<ELEMENT>
		<SYMBOL>PKT</SYMBOL>
		<BYTE>0C</BYTE>
	</ELEMENT>
</MODES>

<!-- lsb mode strings should match those given in the modes id specifier 
     These are the modes reported by the rig that actually use LSB signal processing
-->

<LSBMODES>
	<STRING>LSB</STRING>
	<STRING>CW-R</STRING>
	<STRING>PKT</STRING>
</LSBMODES>

<REPLY>
	<SYMBOL>MODE</SYMBOL>
	<SIZE>5</SIZE>
	<FILL>4</FILL>
	<DATA>
		<DTYPE>BINARY</DTYPE>
		<SIZE>1</SIZE>
	</DATA>
</REPLY>

<REPLY>
	<SYMBOL>FREQ</SYMBOL>
	<SIZE>5</SIZE>
	<DATA>
		<DTYPE>BCD</DTYPE>
		<SIZE> 8 </SIZE>
		<MAX> 470000000 </MAX>
		<MIN> 100000 </MIN>
		<RESOL> 10 </RESOL>
		<REV>false</REV>
	 </DATA>
	<FILL>1</FILL>
</REPLY>	

<COMMAND>
	<SYMBOL>SETFREQ</SYMBOL>
	<SIZE>5</SIZE>
	<DATA>
		<DTYPE>BCD</DTYPE>
		<SIZE> 8 </SIZE>
		<MAX> 470000000 </MAX>
		<MIN> 100000 </MIN>
		<RESOL> 10 </RESOL>
		<REV>false</REV>
	 </DATA>
	<BYTE>01</BYTE>
</COMMAND>

<COMMAND>
	<SYMBOL>GETFREQ</SYMBOL>
	<SIZE>5</SIZE>
	<BYTES>00 00 00 00 03</BYTES>
	<INFO>FREQ</INFO>
</COMMAND>

<COMMAND><SYMBOL>SETMODE</SYMBOL>
	<SIZE>5</SIZE>
	<DATA>
		<DTYPE>BINARY</DTYPE>
		<SIZE>1</SIZE>
	</DATA>
	<BYTES>00 00 00 07</BYTES>
</COMMAND>
	
<COMMAND>
	<SYMBOL>GETMODE</SYMBOL>
	<SIZE>5</SIZE>
	<BYTES>00 00 00 00 03</BYTES>
	<INFO>MODE</INFO>
</COMMAND>

<COMMAND>
	<SYMBOL>PTTON</SYMBOL>
	<SIZE>5</SIZE>
	<BYTES>00 00 00 00 08</BYTES>
</COMMAND>

<COMMAND>
	<SYMBOL>PTTOFF</SYMBOL>
	<SIZE>5</SIZE>
	<BYTES>00 00 00 00 88</BYTES>
</COMMAND>

</RIGDEF>

