<!--
	Rig definition file for use with fldigi
	
	See separate rigxml.odt (Open Office Writer document) for instructions on creating or maintaining
	this file
-->

<RIGDEF>

<RIG>Yaesu 857</RIG>

<PROGRAMMER>
	Dave Freese		W1HKJ
	Tested by:	 	N8FQ, Joe and KD4O, Phil Moore, Rich Newsom, WA4SXZ
</PROGRAMMER>

<STATUS>
	Verified
	Version:	1.0
	Date:		2008 Jun 7
</STATUS>

<TITLE>Rig Control - FT-857</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.
	RTSCTS   specifies whether hardware flow control is used with the radio
	         Many of the Kenwood rigs require RTS/CTS flow control.
	         Set to true to enable this type of control
	         NOTE: you cannot use both RTSCTS and RTSPTT.  If you set both to true the RTSCTS
	         flow control will have priority.
-->

<PORT>
	<BAUD>9600</BAUD>
	<DEVICE>/dev/ttyS0</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>
	<RTSCTS>false</RTSCTS>
</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>OK</SYMBOL>
	<SIZE>1</SIZE>
	<BYTES>00</BYTES>
</REPLY>

<REPLY>
	<SYMBOL>BAD</SYMBOL>
	<SIZE>1</SIZE>
	<BYTES>01</BYTES>
</REPLY>

<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> 500000 </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> 500000 </MIN>
		<RESOL> 10 </RESOL>
		<REV>false</REV>
	 </DATA>
	<BYTE>01</BYTE>
	<OK>OK</OK>
	<BAD>BAD</BAD>
</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>
	<OK>OK</OK>
	<BAD>BAD</BAD>
</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>
	<OK>OK</OK>
	<BAD>BAD</BAD>
</COMMAND>

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

</RIGDEF>

