/* $Id$ */

1. About this utility

Utility was developed on Wouxun KG-UV2D and tested on KG1UVD-P (both 
identify as KG669V). Possibly other Wouxuns are supported too - use at 
your own risk and ALWAYS make backups! This software is experimental. 
Using it can result in rendering your radio unusable and your dog killed. 
You have been warned.

Utility was developed under Linux but ports for other systems can be made. 
It is designed to run on little-endian machines (but can be made by you to 
run on big-endian, grep for "endian"). If you're interested in porting or 
other development please contact us (with ideas or patches).

Utility downloads binary memory map from Wouxun radio to file and uploads 
this file to the radio. This map contains all settings, channels, locks etc. 
It can also export channel table from binary file to CSV file to allow you 
to edit it in your favorite editor or spreadsheet. Edited CSV file can be 
later imported into existing binary file and this binary file sent back to 
radio.

Altering other settings is not possible at this time (it is not needed as 
they are accessible from the menu), but if you want this functionality, 
please let us know.

Newest version can be found at:
http://www.chmurka.net/p/wouxun.tar.gz

Code is licensed on beerware license. You are encouraged to experiment and do 
anything you want as long as you keep this README intact when distributing and 
if you feel that this code has been useful for you, you can send us some beer.

2. Authors

SP5GOF gof (at) chmurka.net - coding
SQ5LWN baseciq (at) baseciq.org - reverse-enginnering and procotol information

3. Interface

Standard RS232/TTL converter on MAX232 or similar is needed. Schematics etc. can 
be found on Google or in your drawer, where cables for older cellular phones are.

Connections:

2.5mm (spk):
- shield: gnd
- ring: radio tx (out)
- tip: unconnected

3.5mm (mic):
- shield: radio rx (in)
- ring: unconnected
- tip: unconnected

4. Compilation

Standard GNU make command will do the stuff. You will need g++ and of course make.

5. Usage

Command line syntax is: wouxun <command> [command parameters]

Valid commands and their parameters:

test -p <port>
get -p <port> -f <binfile>
put -p <port> -f <binfile>
export -f <binfile> -c <csvfile>
import -f <binfile> -c <csvfile>

Examples:

Test connection and get radio ID string:
$ wouxun test -p /dev/ttyS0

Read data from radio to binary file:
$ wouxun get -p /dev/ttyS0 -f wouxun.bin

Write data to radio from binary file:
$ wouxun put -p /dev/ttyS0 -f wouxun.bin

Export csv table from binary file:
$ wouxun export -f wouxun.bin -c wouxun.csv

Import csv table to binary file:
$ wouxun import -f wouxun.bin -c wouxun.csv

Remember to always make backups!
