debian/0000755000000000000000000000000011753041247007172 5ustar debian/rules0000755000000000000000000000125011664557775010273 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS export PREFIX=/usr %: dh $@ debian/control0000644000000000000000000000222711664557775010623 0ustar Source: owx Section: hamradio Priority: optional Maintainer: Antoine Beaupré Build-Depends: debhelper (>= 8.0.0) Standards-Version: 3.9.2 Homepage: http://owx.chmurka.net Vcs-Git: git://git.debian.org/collab-maint/owx.git Vcs-Browser: http://git.debian.org/?p=collab-maint/owx.git;a=summary Package: owx Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: utility to program Wouxun dual-band handheld radios Open Wouxun (OWX) is a portable, open-source, command-line utility designed to program Wouxun dual-banders under any modern UNIX operating system. It supports KG-UV2D, KG-UVD1P and possibly other radios that identify as KG669V (such as Navcomm TK-890, Midland TK-790, Albrecht DB-270, Dynascan DB-48 and other brands). . Utility has five functions. They are used to: . - check radio connection - download binary data from radio - upload binary data to radio - export human-readable spreadsheet from binary data file - import edited spreadsheet into existing binary data file . Binary data contains everything that can be changed in the radio - all settings, channels, current modes of operation etc. debian/README.source0000644000000000000000000000050711664557775011376 0ustar owx for Debian -------------- This package is maintained through git, on the "debian" branch. The "master" branch is merged from upstream SVN with git-svn, using something like: git checkout master git svn fetch git checkout debian git merge master -- Antoine Beaupré , Mon, 7 Nov 2011 20:23:20 -0500 debian/gbp.conf0000644000000000000000000000044411664557775010636 0ustar [git-buildpackage] # we merge the tags on that branch when necessary upstream-branch = master # and we merge the upstream branch here when we upgrade the package debian-branch = debian # we do not checkout the .orig tarball from the tag, but from the # upstream branch upstream-tree = branch debian/source/0000755000000000000000000000000011664557775010515 5ustar debian/source/format0000644000000000000000000000001411664557775011723 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000000142611753041247011047 0ustar owx (0~20110415-3.1) unstable; urgency=low * Non-maintainer upload. * Fix "ftbfs with GCC-4.7": add patch gcc-4.7.patch (missing include). (Closes: #667318) -- gregor herrmann Fri, 11 May 2012 00:34:52 +0200 owx (0~20110415-3) unstable; urgency=low * New patch: add a workaround to some error conditions -- Antoine Beaupré Sun, 27 Nov 2011 20:10:32 -0500 owx (0~20110415-2) unstable; urgency=low * fix symlinks for owx-* scripts -- Antoine Beaupré Sat, 26 Nov 2011 21:38:41 -0500 owx (0~20110415-1) unstable; urgency=low * New patch: add a wrapper script to ease operation, wouxun. * Initial release (Closes: #645521) -- Antoine Beaupré Wed, 26 Oct 2011 21:15:35 -0400 debian/owx.links0000644000000000000000000000046411664557775011100 0ustar usr/share/man/man1/owx.1.gz usr/share/man/man1/owx-get.1.gz usr/share/man/man1/owx.1.gz usr/share/man/man1/owx-put.1.gz usr/share/man/man1/owx.1.gz usr/share/man/man1/owx-check.1.gz usr/share/man/man1/owx.1.gz usr/share/man/man1/owx-import.1.gz usr/share/man/man1/owx.1.gz usr/share/man/man1/owx-export.1.gz debian/compat0000644000000000000000000000000211664557775010413 0ustar 8 debian/owx.10000644000000000000000000001107011664557775010113 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH OWX 1 "October 26, 2011" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME owx \- utility to program Wouxun dual-band handheld radios .SH SYNOPSIS .B owx-check [ -v | -h ] [ -f ] [ -p ] [ -t ] .br .B owx-get [ -v | -h ] [ -f ] [ -p ] [ -t ] -o .br .B owx-put [ -v | -h ] [ -f ] [ -p ] [ -t ] -i -r .br .B owx-export [ -v | -h ] -i -o .br .B owx-import [ -v | -h ] -i -o .SH DESCRIPTION This manual page documents briefly the .B owx commands. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBowx\fP is a set of commands that will allow you to fetch and update configuration on your Wouxun handheld radio. It is made of multiple commands. .SH COMMON OPTIONS These options are common to all commands. .TP .B \-h Show summary of options. .TP .B \-v Show version of program. .TP .B \-c Invoke owx-. Makes sense only if called directly as \fBowx\fP. .SH OPTIONS FOR check, get AND put .TP .B \-f Force operation even if your radio identifies different from a KG669V. Use this option with extreme caution - it is very possible that your radio will be rendered unusable after you use this. It was NEVER tested with any radio different from mentoined above. .TP .B \-p Use port , defaults to /dev/ttyUSB0. Of course you must have appropriate read and write permissions for this device. .TP .B \-t Specify the receive timeout for communication with radio. If you disable it (by setting to 0) and the communication fails, the program will hang forever. You probably don't need to change the default value (5 seconds). .SH USAGE .TP .B owx-check This program just checks for the connection and identification string. It can be used to check that your cable and port works. .TP .B owx-get This program downloads memory map from radio to binary file. Options: -o : binary file to write to .TP .B owx-put This program uploads memory map from binary file to radio. Options: -i : binary file to read from .br -r : reference file Option -r is not mandatory, but recommended. You can specify original, unchanged file (exactly as downloaded using owx-get) and this will speed up memory uploading, as owx will compare input file to this reference file and upload only changed memory pages. When using this option, be sure that nothing has changed in the radio (even the currently selected memory channel) between downloading reference file and using it for upload. This is important as some variables that cross the page boundaries (if there are any in the memory map) could be corrupted by this. Example: owx-get -o file.bin .br cp file.bin backup.bin .br owx-export -i file.bin -o wouxun.csv .br oocalc wouxun.csv .br owx-import -i wouxun.csv -o file.bin .br owx-put -i file.bin -r backup.bin Please do yourself a favour and double-check that you upload the correct file. If you try to upload incorrect or corrupted file, your radio will power down and fail to power up. owx will refuse to upload any file with incorrect size, but this is the only safety check. .TP .B owx-export This program exports channel data from binary file to CSV file. This file can be later edited using your favourite spreadsheet editor or even text editor. Options: -i : binary file to read from .br -o : csv file to write to .TP .B owx-import This program reads the specified, possibly edited by you CSV file, and patches existing binary file with this updated data. The file is now prepared to be uploaded with owx-put. Options: -i : csv file to read from -o : binary file to write to (must already exist) .SH SEE ALSO .BR chirp (1), the README file. .SH AUTHOR owx was written by SP5GOF (Adam Wysocki). .PP This manual page was written by Antoine Beaupré , for the Debian project (and may be used by others). debian/patches/0000755000000000000000000000000011753041211010610 5ustar debian/patches/proper-ln0000644000000000000000000000147611664557775012515 0ustar diff --git a/src/Makefile b/src/Makefile index 34a2949..81696d9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,11 +36,11 @@ install: all $(INSTALL) -d $(LIBXDIR) $(INSTALL) -m 755 $(NAME) $(LIBXDIR) $(INSTALL) -d $(BINDIR) - $(LN) -f -s $(LIBXDIR)$(NAME) $(BINDIR)$(NAME)-check - $(LN) -f -s $(LIBXDIR)$(NAME) $(BINDIR)$(NAME)-get - $(LN) -f -s $(LIBXDIR)$(NAME) $(BINDIR)$(NAME)-put - $(LN) -f -s $(LIBXDIR)$(NAME) $(BINDIR)$(NAME)-export - $(LN) -f -s $(LIBXDIR)$(NAME) $(BINDIR)$(NAME)-import + $(LN) -f -s $(PREFIX)/sbin/$(NAME) $(BINDIR)$(NAME)-check + $(LN) -f -s $(PREFIX)/sbin/$(NAME) $(BINDIR)$(NAME)-get + $(LN) -f -s $(PREFIX)/sbin/$(NAME) $(BINDIR)$(NAME)-put + $(LN) -f -s $(PREFIX)/sbin/$(NAME) $(BINDIR)$(NAME)-export + $(LN) -f -s $(PREFIX)/sbin/$(NAME) $(BINDIR)$(NAME)-import .PHONY: clean clean: debian/patches/tolerant_ack0000644000000000000000000000211011664557775013227 0ustar Description: be more tolerant when opening the radio I had to apply this patch to restore access to my radio when it was refusing to open with errors like: . owx: Invalid ACK char received: 0x4B . I had other errors codes like 0x36, 0x39, 0x47, 0x56, and the patch that made me recover wasn't *exactly* this patch (it wasn't using exceptions) but this should work. Origin: debian Forwarded: no Reviewed-By: Antoine Beaupré Last-Update: 2011-11-27 diff --git a/src/wouxun.cc b/src/wouxun.cc index e4ecee0..c7260c7 100644 --- a/src/wouxun.cc +++ b/src/wouxun.cc @@ -1,5 +1,6 @@ /* $Id$ */ +#include #include #include #include "owxendian.h" @@ -33,7 +34,16 @@ void CWouxun::Open() RecvAck(true); m_comm.SendChar(0x02); - RecvAck(); + try + { + RecvAck(); + } + catch (const std::logic_error &e) + { + // this can return the wrong error codes in some weird + // situations but it will still work so just print a warning + fprintf(stderr, "Warning: %s\n", e.what()); + }; char buf[7]; m_comm.Recv(buf, sizeof(buf)); debian/patches/DESTDIRPREFIX-support0000644000000000000000000000143211664557775014315 0ustar Description: support DESTDIR variable This patch adds support for the PREFIX and DESTDIR variable in the main makefile. --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: debian Forwarded: no Reviewed-By: Antoine Beaupré Last-Update: 2011-10-26 --- owx-0~20110415.orig/src/Makefile +++ owx-0~20110415/src/Makefile @@ -7,8 +7,11 @@ RM = rm -f INSTALL = install LN = ln -LIBXDIR = /usr/local/libexec/ -BINDIR = /usr/local/bin/ +PREFIX?= /usr/local +DESTDIR?= + +LIBXDIR = $(DESTDIR)/$(PREFIX)/libexec/ +BINDIR = $(DESTDIR)/$(PREFIX)/bin/ CXXFLAGS= -pipe -Wall -Wextra -O2 -g LDFLAGS = debian/patches/series0000644000000000000000000000011711753041062012030 0ustar DESTDIRPREFIX-support sbin-libexec proper-ln script tolerant_ack gcc-4.7.patch debian/patches/script0000644000000000000000000001357111664557775012102 0ustar Description: simple wrapper script This script makes the operation on the .csv files more intuitive and reliable. --- /dev/null +++ owx-0~20110415/src/wouxun @@ -0,0 +1,138 @@ +#! /bin/sh -e + +# simple wrapper script around the owx utility + +device=/dev/ttyUSB0 +delay=10 + +usage() { + cat < ] + +-r reload pl2313 kernel module before doing anything (requires sudo) +-i import csv into device +-x export device into csv +-f overwrite existing csv file during export +-n simulate, don't do anything but checks +-h this help + + defaults to wouxun.csv and must exist for import +EOF + trap "" 0 + exit 1 +} + +fail() { + cat < insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +wouxun \- wrapper around the owx utility to operate CSV files directly +.SH SYNOPSIS +.B wouxun ( -i | -x ) [ ] +.SH DESCRIPTION +This manual page documents briefly the +.B wouxun +command. +.SH OPTIONS +These options are common to all commands. +.TP +.B \-h +Show summary of options. +.TP +.B \-n +Simulate, don't do anything but checks. +.TP +.B \-r +Reload the pl2313 kernel module before doing anything (requires sudo). +.TP +.B \-i [ ] +Import the given CSV into the device (defaults to wouxun.csv). +.TP +.B \-x [ ] +Export the device into the given CSV file (defaults to +wouxun.csv). Will not overwrite the file unless +.B \-f +is specified. +.TP +.B \-f +Overwrite any existing .csv file. +.SH SEE ALSO +.BR owx (1), chirp (1), +the README file. +.SH AUTHOR +The wouxun wrapper was writte by Antoine Beaupré . +.PP +This manual page was written by Antoine Beaupré , +for the Debian project (and may be used by others). debian/patches/sbin-libexec0000644000000000000000000000060611664557775013135 0ustar Description: install owx in sbin libexec is not supported by the FHS, install owx in /usr/sbin instead. --- owx-0~20110415.orig/src/Makefile +++ owx-0~20110415/src/Makefile @@ -10,7 +10,7 @@ LN = ln PREFIX?= /usr/local DESTDIR?= -LIBXDIR = $(DESTDIR)/$(PREFIX)/libexec/ +LIBXDIR = $(DESTDIR)/$(PREFIX)/sbin/ BINDIR = $(DESTDIR)/$(PREFIX)/bin/ CXXFLAGS= -pipe -Wall -Wextra -O2 -g debian/patches/gcc-4.7.patch0000644000000000000000000000054311753041211012675 0ustar Description: add include needed by gcc 4.7 Origin: vendor Bug-Debian: http://bugs.debian.org/667318 Forwarded: no Author: gregor herrmann Last-Update: 2012-05-11 --- a/src/file.cc +++ b/src/file.cc @@ -5,6 +5,7 @@ #include "throw.h" #include "intl.h" #include "file.h" +#include CFileBase::CFileBase(): m_fp(NULL) { debian/copyright0000644000000000000000000000205711664557775011154 0ustar Format: http://anonscm.debian.org/gitweb/?p=dbnpolicy/policy.git;a=blob;f=copyright-format/copyright-format.xml;hb=b4d036bab75ac794c3500563768d60ad994ae4f1 Upstream-Name: owx Source: http://owx.chmurka.net/ Files: * Copyright: 2011 SP5GOF (Adam Wysocki) License: Apache-2.0 Files: debian/* Copyright: 2011 Antoine Beaupré License: Apache-2.0 License: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . On Debian systems, the complete text of the Apache version 2.0 license can be found in "/usr/share/common-licenses/Apache-2.0". debian/owx.manpages0000644000000000000000000000003211664557775011542 0ustar debian/owx.1 src/wouxun.1 debian/docs0000644000000000000000000000004411664557775010066 0ustar docs/PROTOCOL docs/TODO docs/README