2002-05-28 21:28:15 +00:00
|
|
|
Hamlib - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
|
2011-01-13 12:08:12 +00:00
|
|
|
(C) Stephane Fillod 2000-2011
|
2025-05-03 17:33:17 +00:00
|
|
|
(C) The Hamlib Group 2000-2025
|
2000-07-18 21:09:51 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Primary site for the latest development version of Hamlib is
|
|
|
|
https://github.com/Hamlib/Hamlib
|
|
|
|
|
2023-09-15 03:11:21 +00:00
|
|
|
Also take a look at http://sourceforge.net/projects/hamlib/
|
2011-06-04 03:58:26 +00:00
|
|
|
Here you will find a mail list, and the latest releases.
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2022-06-17 20:41:29 +00:00
|
|
|
See README.md for frontend/backend outline.
|
2011-06-04 03:58:26 +00:00
|
|
|
See README.betatester for background on testing Hamlib.
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2000-07-18 21:09:51 +00:00
|
|
|
|
2019-06-12 20:52:35 +00:00
|
|
|
The library provides functions for both radio, rotator, and amplifier control,
|
2025-08-28 13:03:31 +00:00
|
|
|
and data retrieval from the radio, rotator, or amplifier. A number of functions
|
|
|
|
useful for calculating distance and bearing and grid square conversion are
|
|
|
|
included.
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2013-09-23 01:58:18 +00:00
|
|
|
libhamlib.so - library that provides generic API for all RIG types.
|
|
|
|
This is what Application programmers will "see". Will have different
|
|
|
|
names on other platforms, e.g. libhamlib-2.dll on MS windows. Also
|
2019-06-12 20:52:35 +00:00
|
|
|
contains all radio, rotator, and amplifier "backends" (formerly in their own
|
2013-09-23 01:58:18 +00:00
|
|
|
dlopen'ed libraries) provided by Hamlib.
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
Backend Examples are:
|
|
|
|
---------------------
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2013-09-23 01:58:18 +00:00
|
|
|
1. yaesu will provide connectivity to Yaesu FT 747GX Transceiver, FT 847
|
|
|
|
"Earth Station", etc. via a standard API.
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
2. xxxx will provide connectivity to the Wiz-bang moon-melter 101A (yikes..)
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Hamlib also enables developers to develop professional looking GUI's towards a
|
|
|
|
unified control library API, and they would not have to worry about the
|
|
|
|
underlying connection towards physical hardware.
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Serial (RS-232) connectivity is built in as are IP (also via a socket utility),
|
|
|
|
and USB. Other connectivity will follow afterwards.
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
General Guidelines.
|
|
|
|
-------------------
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
0. The top level directory looks like this as of 2025-08-27
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
$ tree -L 1
|
2025-05-03 14:24:31 +00:00
|
|
|
.
|
2020-01-17 15:22:44 +00:00
|
|
|
├── amplifiers
|
2013-05-08 02:36:38 +00:00
|
|
|
├── android
|
2025-08-28 13:03:31 +00:00
|
|
|
├── Android.mk
|
|
|
|
├── astyle.sh
|
|
|
|
├── AUTHORS
|
2011-02-14 03:10:44 +00:00
|
|
|
├── bindings
|
2025-08-28 13:03:31 +00:00
|
|
|
├── bootstrap
|
2011-02-14 03:10:44 +00:00
|
|
|
├── c++
|
2025-08-28 13:03:31 +00:00
|
|
|
├── ChangeLog
|
|
|
|
├── CODE_OF_CONDUCT.md
|
|
|
|
├── configure.ac
|
|
|
|
├── CONTRIBUTING.md
|
|
|
|
├── COPYING
|
|
|
|
├── COPYING.LIB
|
|
|
|
├── cppcheck.sh
|
2011-02-14 03:10:44 +00:00
|
|
|
├── doc
|
2025-05-03 14:24:31 +00:00
|
|
|
├── docker-build
|
2020-01-17 15:22:44 +00:00
|
|
|
├── extra
|
2025-08-28 13:03:31 +00:00
|
|
|
├── hamlib.m4
|
|
|
|
├── hamlib.pc.in
|
2011-02-14 03:10:44 +00:00
|
|
|
├── include
|
2025-08-28 13:03:31 +00:00
|
|
|
├── INSTALL
|
2011-02-14 03:10:44 +00:00
|
|
|
├── lib
|
2025-08-28 13:03:31 +00:00
|
|
|
├── LICENSE
|
2011-02-14 03:10:44 +00:00
|
|
|
├── macros
|
2025-08-28 13:03:31 +00:00
|
|
|
├── Makefile.am
|
|
|
|
├── NEWS
|
|
|
|
├── PLAN
|
|
|
|
├── README
|
|
|
|
├── README.betatester
|
|
|
|
├── README.coding_style
|
|
|
|
├── README.developer
|
|
|
|
├── README.freqranges
|
|
|
|
├── README.macos
|
|
|
|
├── README.md
|
|
|
|
├── README.multicast
|
|
|
|
├── README.release
|
|
|
|
├── README.win32
|
2020-01-17 15:22:44 +00:00
|
|
|
├── rigs
|
|
|
|
├── rotators
|
2013-05-08 02:36:38 +00:00
|
|
|
├── scripts
|
2025-05-03 14:24:31 +00:00
|
|
|
├── security
|
2025-08-28 13:03:31 +00:00
|
|
|
├── SECURITY.md
|
|
|
|
├── Segfault-award
|
2025-05-03 14:24:31 +00:00
|
|
|
├── simulators
|
2011-02-14 03:10:44 +00:00
|
|
|
├── src
|
2025-08-28 13:03:31 +00:00
|
|
|
├── tests
|
|
|
|
├── THANKS
|
|
|
|
└── VFOs.txt
|
|
|
|
|
|
|
|
18 directories, 32 files
|
2020-01-17 15:22:44 +00:00
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2002-09-10 06:43:05 +00:00
|
|
|
1. Building
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
If you just want to compile the library, please refer to the INSTALL file. This
|
|
|
|
document introduces hacking the code of Hamlib.
|
|
|
|
|
|
|
|
As your objective is development, either GitHub or SourceForge (hereinafter
|
|
|
|
"forges") offer similar work flows where a "fork" of the main repository is
|
|
|
|
created that is your private copy. Proposed changes that you wish to be added
|
|
|
|
to Hamlib will be "pushed" to your repository after which the Web site (GitHub,
|
|
|
|
at least) will offer a link to create a "pull request" that is done through the
|
|
|
|
Web site's UI. Once the pull request is created on GitHub, Continuous
|
|
|
|
Integration will check your changes and then compile Hamlib on various systems
|
|
|
|
with various configurations. This is the main work flow of the Hamlib project.
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
1.1 Obtaining sources: git clone
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Each forge offers secure methods of authentication and encryption through SSH
|
|
|
|
and provide a special link that is used to "pull" and "push" to your fork.
|
|
|
|
|
|
|
|
Otherwise, if you just want to clone the Git repository anonymously, each offer
|
|
|
|
HTTPS links (SourceForge link shown):
|
|
|
|
|
|
|
|
git clone https://git.code.sf.net/p/hamlib/code hamlib
|
2009-03-07 03:30:17 +00:00
|
|
|
|
2025-08-20 01:12:56 +00:00
|
|
|
The clone only has to be done the first time.
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
After the initial clone, whenever you want to update your local repository,
|
|
|
|
issue the following command in the root directory of Hamlib:
|
2006-07-10 16:15:12 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
git pull
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
This will download and merge any changes from either canonical Hamlib Git
|
|
|
|
repository (what Git calls origin by default). This command actually combines
|
|
|
|
two Git commands, fetch and merge into one that will first check for conflicting
|
|
|
|
changes between your local repository and the remote (origin) repository and
|
|
|
|
will not apply any changes if conflicts are found.
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2013-05-08 02:36:38 +00:00
|
|
|
A pull can be restricted to just a single branch if desired:
|
|
|
|
|
|
|
|
git pull origin master
|
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
1.1.1 Obtaining more info on Git
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Check out the SourceForge page at
|
|
|
|
https://sourceforge.net/p/forge/documentation/Git/ for more information about
|
|
|
|
how to use the Git repository of Hamlib hosted by SourceForge.
|
|
|
|
|
|
|
|
GitHub has much documentation on using its platform. Using either forge is the
|
|
|
|
same from your working directory on your computer. Only the "remote" name is
|
|
|
|
different (your choosing).
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
Much documentation on Git exists. A good starting point is:
|
2006-12-10 14:41:35 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
https://git-scm.com/doc
|
2008-01-06 14:38:37 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
From this page are links to tutorials, books (Pro Git proved useful), and
|
|
|
|
references.
|
2011-01-20 03:23:17 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Another useful site:
|
2011-01-20 03:23:17 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
http://www-cs-students.stanford.edu/~blynn/gitmagic/
|
2011-01-20 03:23:17 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
1.1.2 Providing patches with Git outside of the forges
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
Git provides tools to generate patches and submit them to the Hamlib developers
|
2025-08-28 13:03:31 +00:00
|
|
|
via email. Use of these tools is preferred as Git allows credit to be given to
|
|
|
|
the author and submitter of the patches. Please submit the patches to the
|
|
|
|
hamlib-developer mailing list. See section 8.3.
|
|
|
|
|
|
|
|
Even without Git email tooling, every effort will be made to properly credit all
|
|
|
|
contributions.
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
1.1.3 Git and branches
|
|
|
|
|
|
|
|
One of the most powerful features of Git is its ability to make working with
|
2025-08-28 13:03:31 +00:00
|
|
|
branches easy. It also allows the developers to "cherry pick" patches from the
|
|
|
|
master development branch into stable release branches or vice versa. In this
|
|
|
|
manner we can accommodate patches submitted against a stable release and merge
|
|
|
|
them into master as well.
|
|
|
|
|
|
|
|
After cloning the repository as above, the repository is synchronized with the
|
|
|
|
"master" branch. This can be confirmed by 'git branch'. A new branch can be
|
|
|
|
created by providing a name, 'git branch n0nb_k3_level' which will now exist as
|
|
|
|
a branch in your local repository. This is a good way to work on new features
|
|
|
|
as Git keeps changes to files in each branch separate.
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
As you can see:
|
|
|
|
|
|
|
|
$ git branch
|
|
|
|
Hamlib-1.2.13
|
|
|
|
Hamlib-1.2.13.1
|
|
|
|
* master
|
2025-08-28 13:03:31 +00:00
|
|
|
n0nb_k3_level
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
there are a number of branches in my local repository. Most, such as
|
2025-08-28 13:03:31 +00:00
|
|
|
"Hamlib-1.2.13", exist in the canonical repository as well. They can be seen by
|
|
|
|
'git branch -r' and you can switch to any of them using the 'git checkout
|
|
|
|
BRANCH_NAME' command.
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
Finally, once your changes are ready for inclusion in Hamlib, commit your
|
2025-08-28 13:03:31 +00:00
|
|
|
changes to the branch you are working in and "push" the commits to the forge.
|
|
|
|
|
|
|
|
GitHub, at least, will return a URL that can be opened in your Web browser to
|
|
|
|
create the Pull Request (PR). SourceForge may offer similar capability.
|
|
|
|
|
|
|
|
Unlike previously stated in this document, there is no need to merge your
|
|
|
|
commits into the "master" branch before pushing. In fact, it is preferred that
|
|
|
|
PRs remain as a separate branch.
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
1.1.4 Summary
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
This is a very brief introduction to Git for Hamlib developers. Day-to-day Git
|
|
|
|
usage involves a handful of commands--clone, status, commit, pull, branch,
|
|
|
|
checkout, merge, and push are probably the most common. Other useful commands
|
|
|
|
are log and diff to see changes (especially when color output is enabled in your
|
|
|
|
Git configuration). See the references above to learn about setting up Git to
|
|
|
|
your preference.
|
2011-04-03 13:52:46 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
If you like a GUI tool several exist. Gitk and Gitg are similar with the former
|
|
|
|
being written with the Tk toolkit and the latter in GTK+ and both supplied by
|
|
|
|
the Git project. Many more are available as are many ways to integrate Git into
|
|
|
|
your favorite editor (this crusty author prefers to work with Git in a separate
|
|
|
|
terminal window, although "git blame" in the Vim editor is handy). All allow
|
|
|
|
looking at the complete history of the repository and changes made to any file.
|
2011-01-20 03:23:17 +00:00
|
|
|
|
|
|
|
|
2002-10-29 22:14:58 +00:00
|
|
|
1.2. Requirements
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Hamlib is entirely developed using GNU tools, under various operating systems
|
|
|
|
include Microsoft Windows. Note that Hamlib is not restricted to Linux or Unix
|
|
|
|
type systems, MS Windows is well supported.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
That is, if you want to take part in the development of Hamlib, you'll need the
|
|
|
|
following tools. Make sure you have at least the required version or you won't
|
|
|
|
even be able to build from the Git clone.
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
N.B. The Debian and derivatives (Ubuntu and friends) 'build-essential' package
|
|
|
|
will install a number of tools and minimize the number of packages that need to
|
|
|
|
be installed manually (Debian package names are listed, other distributions may
|
|
|
|
differ).
|
2011-01-20 03:23:17 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
* Gnu C or any C99 compliant compiler # gcc --version
|
|
|
|
* Gnu make (or any modern one, BSD okay) # make --version
|
2025-08-28 13:03:31 +00:00
|
|
|
* autoconf 2.69 # autoconf --version
|
|
|
|
* automake 1.16 # automake --version
|
|
|
|
* libtool 2.4.6 # libtool --version
|
|
|
|
* Git 2.30 # git --version
|
2025-08-20 01:12:56 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
As of Hamlib 4.7.0 (commit e09007a), POSIX thread support (pthreads) is
|
|
|
|
required to compile or run Hamlib.
|
2010-01-24 23:18:44 +00:00
|
|
|
|
2010-12-24 23:06:22 +00:00
|
|
|
Optional, but highly recommended:
|
2025-08-28 13:03:31 +00:00
|
|
|
* GNU C++ # Build C++ binding and INDI backend
|
|
|
|
* swig (for bindings) # Generate wrappers for the bindings
|
|
|
|
* perl devel # For Perl binding
|
|
|
|
* tcl devel # For tcl binding
|
|
|
|
* python devel # For Python binding
|
2025-06-15 17:53:41 +00:00
|
|
|
* pytest
|
2025-08-28 13:03:31 +00:00
|
|
|
* lua devel # For Lua binding
|
2008-01-06 14:38:37 +00:00
|
|
|
* libxml2 devel # xml2-config --version
|
2025-05-03 22:05:08 +00:00
|
|
|
* libgd2 devel # gdlib-config --version (rigmatrix)
|
|
|
|
* libindi devel # INDI rotators
|
|
|
|
* libnova devel
|
2025-08-28 13:03:31 +00:00
|
|
|
* libusb-1.0 devel # 1.0.24 or newer
|
2013-02-23 03:43:14 +00:00
|
|
|
* libreadline devel # ver 5.2 or newer
|
2025-05-03 14:51:37 +00:00
|
|
|
* pkg-config # pkg-config --version (libxml and USRP)
|
2025-05-03 22:05:08 +00:00
|
|
|
* zlib1g devel # (rigmatrix)
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2016-03-23 02:47:27 +00:00
|
|
|
N.B.: The libusb-1.0 package is required for building most of the 'kit'
|
|
|
|
backend. The older version of libusb 0.1.x is no longer supported.
|
2011-02-01 16:31:20 +00:00
|
|
|
|
|
|
|
N.B.: Some systems can have several versions of the autotools installed. In
|
2025-08-28 13:03:31 +00:00
|
|
|
that case, autoconf may be called "autoconf2.69", autoheader "autoheader2.69",
|
|
|
|
and automake "automake-1.16" aclocal "aclocal-1.16" or a newer version.
|
|
|
|
|
|
|
|
IMPORTANT: If autoconf or automake are installed on your system, make sure they
|
|
|
|
are matching *at least* the version shown above.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
!!!BEWARE!!! Some systems have the "Autoconf Macro Archive" package installed.
|
|
|
|
These newer macros will conflict with similarly named macros in the 'macros'
|
|
|
|
directory. See GitHub issue #1746 for the gory details
|
|
|
|
(https://github.com/Hamlib/Hamlib/issues/1746).
|
2002-10-29 22:14:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
1.3. configure and build stage
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
It is important to note that the Git repository holds no Autotools generated
|
|
|
|
files, i.e. configure, config.guess, Makefile, etc. Hence after a fresh
|
|
|
|
checkout, you'll have to generate those files.
|
2006-11-07 21:57:57 +00:00
|
|
|
|
2017-07-28 02:30:13 +00:00
|
|
|
To proceed, first edit the bootstrap script, and set appropriately the
|
2012-10-11 14:17:58 +00:00
|
|
|
AUTORECONF, AUTOMAKE, and LIBTOOLIZE variables with the required versions seen
|
2025-08-28 13:03:31 +00:00
|
|
|
in the previous section (most systems will be fine with the default names, only
|
|
|
|
do this if a problem arises and please let us know).
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2010-01-24 23:18:44 +00:00
|
|
|
cd hamlib
|
2017-07-28 02:30:13 +00:00
|
|
|
./bootstrap
|
|
|
|
./configure [CFLAGS="-g -O0"]
|
2008-01-06 14:38:37 +00:00
|
|
|
make
|
|
|
|
make install
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2017-07-28 02:30:13 +00:00
|
|
|
Note: Depending on the value of '--prefix' passed to 'configure', superuser
|
|
|
|
(root) privileges may be needed for 'make install'.
|
|
|
|
|
2010-04-16 22:14:10 +00:00
|
|
|
If you don't want the build files cluttering the source directories, do the
|
2007-11-14 03:15:31 +00:00
|
|
|
following in the same parent directory of hamlib:
|
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
mkdir build && cd build
|
2017-07-28 02:30:13 +00:00
|
|
|
../hamlib/bootstrap
|
|
|
|
../hamlib/configure [CFLAGS="-g -O0"]
|
2008-01-06 14:38:37 +00:00
|
|
|
make
|
|
|
|
make install
|
2007-11-14 03:15:31 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Note: In the examples above, passing the CFLAGS environment variable is optional
|
|
|
|
as shown using the square brackets..
|
2012-10-11 14:17:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
This will keep the binary output files separate from the source tree and aid in
|
|
|
|
development by reducing clutter in the source tree.
|
2007-11-14 03:15:31 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Once you've run 'bootstrap', make sure you've got some recent config.guess and
|
|
|
|
config.sub (needed to guess your system type). Anything of at least year 2004
|
|
|
|
should be fine, unless you run some exotic hardware/software system (modern
|
|
|
|
Linux distributions and Cygwin keep these up to date):
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
./config.guess --version
|
|
|
|
./config.sub --version
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
The '--prefix' option to 'configure' is optional and not shown as it defaults to
|
|
|
|
/usr/local. Convention is that locally built packages be installed in
|
2012-10-11 14:17:58 +00:00
|
|
|
/usr/local away from distribution installed packages. The 'CFLAGS="-g -O0"'
|
|
|
|
environment variable generates less optimized binaries with the '-O0' while the
|
2011-06-21 03:29:19 +00:00
|
|
|
'-g' option adds debugging info which can be changed to -ggdb to generate
|
|
|
|
debugging info for gdb.
|
2011-01-20 03:23:17 +00:00
|
|
|
|
2011-02-01 16:31:20 +00:00
|
|
|
Additionally, you may want to add the '--with-perl-binding' or
|
2025-08-28 13:03:31 +00:00
|
|
|
'--with-python-binding' or '--with-tcl-binding' or '--with-lua-binding' if you
|
|
|
|
are interested in SWIG binding support for those scripting languages.
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-03-31 01:34:43 +00:00
|
|
|
For LUA bindings if you run "lua luatest.lua" and see this error message:
|
2020-01-19 17:15:44 +00:00
|
|
|
luatest.lua:44: Error in Rig::set_mode (arg 2), expected 'rmode_t' got 'string'
|
2025-08-28 13:03:31 +00:00
|
|
|
This means you need to upgrade both swig and lua for 64-bit lua support This is
|
|
|
|
known to work on swig 4.0.1 and lua 5.3.5
|
2020-01-19 17:15:44 +00:00
|
|
|
|
2017-07-28 02:30:13 +00:00
|
|
|
NOTE: The bootstrap script has only to be run the first time after a fresh
|
2025-08-28 13:03:31 +00:00
|
|
|
checkout or when a Makefile.am or other build file is modified or added (usually
|
|
|
|
this is not the case as the build system will automatically generate itself when
|
|
|
|
it detects its source has been modified, but once in a while...).
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2006-11-07 21:57:57 +00:00
|
|
|
For a Tcl build, add this if needed:
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
--with-tcl=/usr/lib/tcl8.2
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Note: C-shell users may have to run bootstrap and make through a bourne shell
|
|
|
|
instead, or pass "SHELL=bash" as a parameter to make.
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Some basic testing is accomplished with the 'make check' target which will run a
|
|
|
|
few predetermined tests using the 'dummy' (rig model 1) backend and some other
|
|
|
|
Hamlib functions in the build tree. This is a basic sanity check and cannot test
|
|
|
|
all backends.
|
2013-05-09 01:48:34 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Likewise, a complete test of the build system is accomplished with 'make
|
|
|
|
distcheck' which exercises a complete build sequence from creating a
|
|
|
|
distribution tarball, building, installing, uninstalling, and cleaning Hamlib.
|
|
|
|
All packages listed above except for Swig and Doxygen are required for this
|
|
|
|
target as neither the bindings or old documentation are generated in a default
|
|
|
|
build.
|
2013-05-09 01:48:34 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
NOTE! If Hamlib has not been previously installed as a locally built package
|
|
|
|
you will need to make sure that 'ldconfig' is configured correctly and run
|
|
|
|
periodically after 'make install'. Most modern distributions have an
|
|
|
|
/etc/ld.so.conf.d/ directory where local configuration can be made. Later
|
|
|
|
versions of Debian and derivatives have a file named 'libc.conf' in this
|
|
|
|
directory. The contents of libc.conf are:
|
2011-02-01 16:31:20 +00:00
|
|
|
|
|
|
|
# libc default configuration
|
|
|
|
/usr/local/lib
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
If your system does not have such a file, one will need to be created and then
|
|
|
|
'ldconfig' will need to be run as the root user so that applications using the
|
|
|
|
Hamlib libraries can find them.
|
2011-02-01 16:31:20 +00:00
|
|
|
|
2002-10-29 22:14:58 +00:00
|
|
|
|
2021-05-18 16:16:15 +00:00
|
|
|
1.3.1 Doxygen generated reference manual
|
|
|
|
|
|
|
|
The following packages need to be installed:
|
|
|
|
* Doxygen
|
|
|
|
* GNU Source-highlight
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2021-05-18 16:16:15 +00:00
|
|
|
1.3.1.1 HTML manual
|
|
|
|
|
|
|
|
In the top level of the build directory:
|
|
|
|
|
|
|
|
cd doc
|
|
|
|
make doc
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
will build the HTML manual. The resulting 'doc/html' directory contains all of
|
|
|
|
the files needed for the HTML manual. The 'index.html' file is the entry point
|
|
|
|
to the manual.
|
|
|
|
|
2021-05-18 16:16:15 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
1.3.1.2 PDF manual (not recently tested)
|
2021-05-18 16:16:15 +00:00
|
|
|
|
|
|
|
To generate the PDF version of the reference manual the following texlive
|
|
|
|
packages are required (Debian package names shown):
|
|
|
|
* texlive-latex-base
|
|
|
|
* texlive-latex-recommended
|
|
|
|
* texlive-latex-extra
|
|
|
|
|
|
|
|
Set GENERATE_LATEX in 'doc/hamlib.cfg.in' to 'YES' which will enable the LaTEX
|
|
|
|
build. Then run:
|
|
|
|
|
|
|
|
make doc
|
|
|
|
|
|
|
|
as above and once the run is complete:
|
|
|
|
|
|
|
|
cd latex
|
|
|
|
make
|
|
|
|
|
|
|
|
The resulting generated document in the 'latex' directory is 'refman.pdf'.
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-06-15 17:53:41 +00:00
|
|
|
1.3.2 Automated tests
|
|
|
|
|
|
|
|
Automated tests are executed running:
|
|
|
|
|
|
|
|
make check
|
|
|
|
|
|
|
|
The makefiles run the simple tests with automake.
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-06-15 17:53:41 +00:00
|
|
|
The make variable TESTS contains the tests to be run and the variables
|
2025-08-28 13:03:31 +00:00
|
|
|
check_PROGRAMS and check_SCRIPTS contain the executables needed to run the tests
|
|
|
|
that aren't built by make all.
|
|
|
|
|
2025-06-15 17:53:41 +00:00
|
|
|
For more information see the automake manual at
|
|
|
|
https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-06-15 17:53:41 +00:00
|
|
|
1.3.2.1 C tests
|
|
|
|
|
|
|
|
Tests written in C are available in the tests/ directory. They are run with:
|
|
|
|
|
|
|
|
make -C tests/ check
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-06-15 17:53:41 +00:00
|
|
|
1.3.2.2 Python tests with pytest
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Tests written in Python are available in the bindings/python directory if Hamlib
|
|
|
|
is configured to build the Python bindings and if pytest is installed, e.g.:
|
2025-06-15 17:53:41 +00:00
|
|
|
|
|
|
|
./configure --with-python-binding --enable-pytest
|
|
|
|
|
|
|
|
They are run with:
|
|
|
|
|
|
|
|
make -C bindings/ check
|
|
|
|
|
|
|
|
The Python scripts consist in handwritten tests, meant to test realistic use
|
2025-08-28 13:03:31 +00:00
|
|
|
cases, and auto-generated tests, meant to detect unwanted changes in the
|
2025-06-15 17:53:41 +00:00
|
|
|
bindings. When a public symbol is added to the bindings or removed, the
|
2025-08-28 13:03:31 +00:00
|
|
|
auto-generated tests must be updated:
|
2025-06-15 17:53:41 +00:00
|
|
|
|
|
|
|
make -C bindings/ generate-pytests
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
And the handwritten tests should be updated to reflect the change.
|
|
|
|
|
|
|
|
The Python tests can also be run against a simulator or an actual rig, but they
|
|
|
|
aren't guaranteed to succeed because the CI only tests the dummy rig. To
|
|
|
|
execute the tests from the build tree, add the path to the libraries that you
|
|
|
|
built, using the PYTHONPATH environment variable, eg:
|
2025-06-15 17:53:41 +00:00
|
|
|
|
2025-07-27 09:04:52 +00:00
|
|
|
PYTHONPATH=bindings/:bindings/.libs/ bindings/python/test_rig.py \
|
|
|
|
--model 1035 --rig-file /dev/ttyUSB0 --serial-speed 4800
|
|
|
|
|
|
|
|
Only the following long arguments are supported:
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-07-27 09:04:52 +00:00
|
|
|
--model ID
|
|
|
|
--rig-file DEVICE
|
|
|
|
--serial-speed BAUD
|
|
|
|
--hamlib-verbose
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-07-27 09:04:52 +00:00
|
|
|
The argument --hamlib-verbose can be repeated as many times as the --verbose
|
|
|
|
argument accepted by rigctl.
|
|
|
|
|
2021-05-18 16:16:15 +00:00
|
|
|
|
2002-10-29 22:14:58 +00:00
|
|
|
1.4. Feedback
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
The Hamlib team is very interested to hear from you, how Hamlib builds and works
|
|
|
|
on your system, especially on non-Linux or non-PC systems. We are trying to make
|
|
|
|
Hamlib as portable as possible. Please report problems to our developer mailing
|
|
|
|
list, hamlib-developer@lists.sourceforge.net
|
2006-11-07 21:57:57 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
Patches are welcome too! Just send them to the mailing list. Git formatted
|
2025-08-28 13:03:31 +00:00
|
|
|
patches are preferred. Unified diff format (diff -u) is also welcome. Patches
|
|
|
|
should apply to the current Git master branch or a testing branch, if possible.
|
|
|
|
If you're patching against an older released version of Hamlib, we can take
|
|
|
|
those as well but please document the release the diff is generated against.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2006-07-10 16:15:12 +00:00
|
|
|
So far, Hamlib has been tested successfully under the following systems:
|
2004-02-08 17:40:55 +00:00
|
|
|
(if your system is not present, please report to the mailing list)
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
* Debian (plus derivatives--Ubuntu, etc.)
|
|
|
|
* Raspberry Pi OS (Raspberry Pi Debian derivative)
|
|
|
|
* Fedora
|
2025-08-20 01:12:56 +00:00
|
|
|
* openSUSE (Leap & Tumbleweed)
|
2025-08-28 13:03:31 +00:00
|
|
|
* Slackware
|
2008-01-06 14:38:37 +00:00
|
|
|
* FreeBSD & NetBSD
|
2025-08-28 13:03:31 +00:00
|
|
|
* MacOS
|
|
|
|
* MS Windows: Cygwin, Mingw, can be imported into MSVC
|
|
|
|
|
|
|
|
|
|
|
|
1.5. A word about AI
|
|
|
|
|
|
|
|
Over the past several years the latest rage is so-called Artificial
|
|
|
|
Intelligence, a.k.a. Large-language Learning Models (LLM). Companies are
|
|
|
|
pushing using AI for development. GitHub (owned by Microsoft) seems to be
|
|
|
|
pushing "Copilot" at every turn. Many thoughts about this technology exist
|
|
|
|
among Free Software developers.
|
|
|
|
|
|
|
|
Perhaps the most questionable aspect of LLM generated code is licensing--can
|
|
|
|
such code be licensed under the GPL/LGPL? It's not an easy question to answer.
|
|
|
|
Code that is written by a developer is copyrighted by that developer, presuming
|
|
|
|
it is original work. That does not change even when code is collaboratively
|
|
|
|
developed and held in a common repository. Ostensibly, the developer has
|
|
|
|
written the code and not plagiarized that of someone else without due credit
|
|
|
|
(certainly, it is fine to "borrow" code from compatibly licensed projects, just
|
|
|
|
credit the project/authors and disclaim it is your original work).
|
|
|
|
|
|
|
|
The question leads to another question, did the LLM have access to sources that
|
|
|
|
were licensed under an incompatible license? Could this lead to a copyright
|
|
|
|
infringement issue? At this time LLMs don't seem to reveal their learning
|
|
|
|
sources and Copilot likely has access to closed sources that are hosted at
|
|
|
|
GitHub.
|
|
|
|
|
|
|
|
The Hamlib project accepts contributions on the "honor system". It is implied
|
|
|
|
that contributions are the original works of their respective authors and
|
|
|
|
offered under the license terms of the GPL 2.0 or LGPL 2.1. Use of LLM
|
|
|
|
generated code breaks this model. The contributors of such code cannot claim it
|
|
|
|
as their own original work.
|
|
|
|
|
|
|
|
Finally, Hamlib is a hobby project for hobbyists and as such all contributors
|
|
|
|
should take pride in having their original work included for the benefit of many
|
|
|
|
other radio hobbyists. Against that backdrop, using LLM generated code seems
|
|
|
|
like cheating.
|
2002-09-10 06:43:05 +00:00
|
|
|
|
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
2. How to add a new backend
|
2006-11-07 21:57:57 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
The rule is one backend per protocol family.
|
|
|
|
Try to share code between rigs of the same family, if applicable.
|
2013-09-23 01:58:18 +00:00
|
|
|
The steps in Section 3 below will need to be followed as well.
|
2020-03-30 04:03:21 +00:00
|
|
|
Version numbers used are in the form YYYYMMDD.N where the .N is
|
|
|
|
intended for multiple versions in one day....so typically would be .0
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
2.1. mkdir mybackend
|
2010-04-16 22:14:10 +00:00
|
|
|
Create a new subdir, of the name of the protocol backend.
|
2008-01-06 14:38:37 +00:00
|
|
|
NB: the directory MUST be the same as the backend name.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2015-12-27 11:09:44 +00:00
|
|
|
2.2. Add <mybackend> to the DIST_SUBDIRS variable in the topdir
|
|
|
|
Makefile.am (not needed for rotators)
|
2009-06-03 18:01:20 +00:00
|
|
|
|
2010-04-16 22:14:10 +00:00
|
|
|
2.3. Add the backend name to the BACKEND_LIST variable (add to
|
2019-06-12 20:52:35 +00:00
|
|
|
ROT_BACKEND_LIST for a new rotor backend or to AMP_BACKEND_LIST for
|
|
|
|
a new amplifier) in configure.ac.
|
2009-06-03 18:01:20 +00:00
|
|
|
|
2010-04-16 22:14:10 +00:00
|
|
|
2.4. Add "mybackend/Makefile" in the AC_CONFIG_FILES macro at the bottom
|
2012-12-02 19:28:23 +00:00
|
|
|
of configure.ac.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2013-09-23 01:58:18 +00:00
|
|
|
2.5. Add DEFINE_INITRIG_BACKEND(mybackend); to the end of the existing list
|
|
|
|
in src/register.c or, for a new rotor backend, add
|
|
|
|
DEFINE_INITROT_BACKEND(myrotbackend); to src/rot_reg.c.
|
|
|
|
|
|
|
|
2.6. Add { RIG_MYBACKEND, RIG_BACKEND_MYBACKEND, RIG_FUNCNAM(mybackend) }, to
|
|
|
|
the rig_backend_list structure in src/register.c or, add
|
|
|
|
{ ROT_MYROTBACKEND, ROT_BACKEND_MYROTBACKEND, ROT_FUNCNAMA(myrotbackend) },
|
|
|
|
to the rot_backend_list structure in src/rot_reg.c.
|
2019-06-12 20:52:35 +00:00
|
|
|
{ AMP_MYAMPBACKEND, AMP_BACKEND_MYAMPBACKEND, AMP_FUNCNAMA(myaotbackend) },
|
|
|
|
to the aot_backend_list structure in src/amp_reg.c.
|
2013-09-23 01:58:18 +00:00
|
|
|
|
2019-06-12 20:52:35 +00:00
|
|
|
2.7. Add the new backend to include/hamlib/riglist.h or include/hamlib/rotlist.h or include/hamlib/amplist.h
|
2013-09-23 01:58:18 +00:00
|
|
|
by selecting the next higher backend ID number.
|
|
|
|
|
|
|
|
2.8. Create mybackend/Makefile.am, mybackend.c mybackend.h
|
2008-01-06 14:38:37 +00:00
|
|
|
Use 'dummy' backend as a template.
|
|
|
|
Here are commands for the bourne shell:
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
$ automake mybackend/Makefile
|
|
|
|
$ CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=mybackend/Makefile ./config.status
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
make in topdir to rebuild all
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2013-09-23 01:58:18 +00:00
|
|
|
2.9. Commit your work to your local repository. (developer access to
|
2011-04-03 13:52:46 +00:00
|
|
|
Hamlib Git required for pushing to the canonical Hamlib repository
|
|
|
|
(origin)) Provide patches to the mailing list:
|
2009-03-07 03:30:17 +00:00
|
|
|
(Please let N0NB know if the commands below are incorrect)
|
2011-04-03 13:52:46 +00:00
|
|
|
|
|
|
|
$ git status # Show uncommitted/staged/unstaged files
|
|
|
|
$ git add mybackend
|
2008-01-06 14:38:37 +00:00
|
|
|
$ cd mybackend
|
2009-03-07 03:30:17 +00:00
|
|
|
(The following command might not be necessary)
|
2011-04-03 13:52:46 +00:00
|
|
|
$ git add Makefile.am mybackend.c mybackend.h
|
|
|
|
|
|
|
|
While specifying each file individually as above allows for fine-
|
|
|
|
grained control, git offers a wildcard shortcut to add all new files:
|
2013-09-23 01:58:18 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
$ git add .
|
2013-09-23 01:58:18 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
Be careful! If you have other files that were created as part of the
|
|
|
|
build process, this command will add them too unless they match a
|
|
|
|
pattern in .gitignore. Always check with 'git status' first!
|
|
|
|
|
|
|
|
$ git commit -m "Initial release" Makefile.am mybackend.c mybackend.h
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2020-05-30 23:30:29 +00:00
|
|
|
Note: The '-m' switch passes a short message to the Git repository
|
|
|
|
upon a commit. If a longer message is desired, do not use the '-m'
|
2011-02-01 16:31:20 +00:00
|
|
|
option. The editor specified in the EDITOR or VISUAL environment
|
|
|
|
variables will be started where a more detailed message may be
|
2011-01-20 03:23:17 +00:00
|
|
|
composed.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
2013-09-23 01:58:18 +00:00
|
|
|
2.10 If you have developer access to the Git repository hosted at Source
|
2011-04-03 13:52:46 +00:00
|
|
|
Forge, you can do the following:
|
|
|
|
$ git push origin
|
|
|
|
|
|
|
|
Your changes will now be available to others.
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2013-09-23 01:58:18 +00:00
|
|
|
|
2008-11-09 14:26:04 +00:00
|
|
|
3. How to add a new model to an existing backend
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
3.1. Make sure there's already a (unique) ID for the model to be added
|
2019-06-12 20:52:35 +00:00
|
|
|
in include/hamlib/riglist.h or include/hamlib/rotlist.h or include/hamlib/amplist.h
|
2008-01-06 14:38:37 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
3.2. Locate the existing backend
|
2008-01-06 14:38:37 +00:00
|
|
|
3.3. Clone the most similar model in the backend
|
2010-04-16 22:14:10 +00:00
|
|
|
3.4. Add the new C file to the _SOURCES variable
|
2008-01-06 14:38:37 +00:00
|
|
|
of the backend's Makefile.am
|
|
|
|
|
|
|
|
3.5. Add "extern const struct rig_caps <mymodel>_caps;" to mybackend.h
|
2010-04-16 22:14:10 +00:00
|
|
|
3.6. In initrigs_<mybackend> of mybackend.c,
|
2008-01-06 14:38:37 +00:00
|
|
|
add "rig_register(&<mymodel>_caps);"
|
|
|
|
|
2020-05-30 23:30:29 +00:00
|
|
|
3.7. Run 'make' if you have dependencies, or the following to regenerate
|
2008-01-06 14:38:37 +00:00
|
|
|
the makefile:
|
|
|
|
$ automake mybackend/Makefile
|
|
|
|
$ CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=mybackend/Makefile ./config.status
|
|
|
|
|
2020-05-30 23:30:29 +00:00
|
|
|
Run 'make' in topdir to rebuild all.
|
2008-01-06 14:38:37 +00:00
|
|
|
|
|
|
|
3.8. Commit your work (once tests are satisfactory):
|
2016-12-25 17:38:57 +00:00
|
|
|
$ git add .
|
|
|
|
$ git commit -m "added <mymodel> to <mybackend>".
|
2008-01-06 14:38:37 +00:00
|
|
|
|
|
|
|
Note: See Note in section 2.6 above.
|
2016-12-25 17:38:57 +00:00
|
|
|
Note: The '.' character is a Git wildcard that includes all new and
|
|
|
|
modified files in your working tree.
|
|
|
|
|
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
|
|
|
The '-m' option may be omitted, in which case Git will start
|
2016-12-25 17:38:57 +00:00
|
|
|
your default editor for a longer commit message. Commit
|
|
|
|
messages generally have the form of a short subject line, then
|
|
|
|
a blank line, and then as much text (broken into paragraphs as
|
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
|
|
|
needed) as needed for a good description of the commit.
|
2016-12-25 17:38:57 +00:00
|
|
|
|
|
|
|
Assuming your working tree was cloned from the SF.net repository
|
|
|
|
or N0NB's GitHub repository, you can now issue a pull request
|
|
|
|
inclusion of your new model into Hamlib.
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
4. Read README.betatester to test the new backend/model.
|
|
|
|
Report to mailing list.
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2006-11-07 21:57:57 +00:00
|
|
|
|
2007-11-14 03:15:31 +00:00
|
|
|
5. Basic functions: set/get_freq, set/get_mode, and set/get_vfo would be a
|
|
|
|
good starting point for your new backend.
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2006-11-07 21:57:57 +00:00
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
6. C code examples.
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
A C code snippet to connect to a FT847 and set the frequency of the main VFO to
|
|
|
|
439,700,000 Hz, using FM as the required mode, would look something like this.
|
|
|
|
The error checking is removed for simplicity.
|
2002-05-28 21:28:15 +00:00
|
|
|
|
|
|
|
See tests/testrig.c
|
2000-08-20 21:52:27 +00:00
|
|
|
|
|
|
|
|
2002-05-28 21:28:15 +00:00
|
|
|
7. Where are the GUI's?
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
"Build it and they will come ..."
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Seriously, I am hoping the API's will provide a solid framework for some cool
|
|
|
|
GUI development. I would like to see some GTK or Qt apps that use the Hamlib
|
|
|
|
APIs so they can be used by end users as a nice part of the Ham shack.
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2010-04-16 22:14:10 +00:00
|
|
|
Starting points (not exhaustive):
|
2011-02-14 03:10:44 +00:00
|
|
|
Fldigi, CQRlog, gmfsk, gpredict, grig, klog, kontakt, ktrack, xlog
|
2006-07-10 16:15:12 +00:00
|
|
|
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2005-03-25 22:27:32 +00:00
|
|
|
8. Contributing code
|
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
8.1 License
|
|
|
|
|
2011-02-01 16:31:20 +00:00
|
|
|
Contributed code to the Hamlib frontend must be released under the LGPL.
|
|
|
|
Contributed code to Hamlib backends must follow backend current license.
|
2008-01-06 14:38:37 +00:00
|
|
|
Needless to say, the LGPL is the license of choice.
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
End user applications like rigctl, rotctl, ampctl and networked daemons should
|
|
|
|
be released under the GPL, so any contributed code must follow the license.
|
2008-01-06 14:38:37 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
8.2 Coding guidelines and style
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2017-08-05 14:01:05 +00:00
|
|
|
For specific requirements for formatting the C source code, see
|
|
|
|
README.coding_style.
|
2011-02-14 03:10:44 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Any header files included from the include/hamlib/ directory should be enclosed
|
|
|
|
in '<>':
|
2016-02-14 19:06:11 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
#include <hamlib/rig.h> # Per GNU GCC documentation
|
2011-02-14 03:10:44 +00:00
|
|
|
|
|
|
|
Other included header files (backend and rig specific headers) should be
|
|
|
|
enclosed in "":
|
2016-02-14 19:06:11 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
#include "yaesu.h"
|
2011-02-14 03:10:44 +00:00
|
|
|
|
2011-02-01 16:31:20 +00:00
|
|
|
Contributed code should always keep the source base in a compilable state,
|
2011-01-20 03:23:17 +00:00
|
|
|
and not regress unless stated otherwise.
|
2006-07-10 16:15:12 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
There's no need to tag the source in a patch with your name in comments behind
|
|
|
|
each modification, we already know the culprit from commit logs (also see "git
|
|
|
|
blame"). :-)
|
2002-11-28 22:34:22 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Patches should take portability issues into account. Keep in mind Hamlib has to
|
|
|
|
run under:
|
2000-08-20 21:52:27 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
* various Linux's
|
|
|
|
* NetBSD, FreeBSD
|
|
|
|
* MacOS X
|
|
|
|
* Windows: MinGW/Cygwin, and VisualC++ support for rig.h
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
Hamlib should also compile with the following common compilers:
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
* gcc
|
2008-01-06 14:38:37 +00:00
|
|
|
* in shared and static
|
2019-06-12 20:52:35 +00:00
|
|
|
* C++ compiler against rig.h, riglist.h, rotator.h, amplifier.h
|
2016-02-09 17:26:23 +00:00
|
|
|
* clang compiler
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
Portability issues to watch:
|
2000-09-24 02:19:42 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
* C99 is probably (in 2016) a reasonable target--C11/C17 minimum is being
|
|
|
|
considered for Hamlib 5.
|
2008-01-06 14:38:37 +00:00
|
|
|
* little vs. big endian systems (use shifts or adhoc functions)
|
2016-02-09 17:26:23 +00:00
|
|
|
* printf/scanf of 64bit int: use PRIll (cast value to int64_t) and SCNll
|
2008-01-06 14:38:37 +00:00
|
|
|
* printf/scanf of freq_t: use PRIfreq and SCNfreq
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Note that 32 bit support is fading across all sectors of computing. At some
|
|
|
|
point limitations regarding 32 bit support will fade away. Hamlib 5 may
|
|
|
|
eliminate 32 bit support entirely.
|
|
|
|
|
2013-05-08 02:36:38 +00:00
|
|
|
Testing:
|
|
|
|
|
|
|
|
* The acid test for the build system is 'make distcheck' which will
|
|
|
|
make a distribution tarball, extract, configure, and build it in a
|
|
|
|
subdirectory, run 'make check', install it, uninstall it, and clean
|
|
|
|
it up. When all those tests pass, the GNU build system declares the
|
|
|
|
package ready for distribution. This is a good test if you have
|
|
|
|
touched the build system files or added a backend.
|
|
|
|
|
2025-05-03 22:08:44 +00:00
|
|
|
Simulators:
|
2025-05-04 08:46:28 +00:00
|
|
|
* The 'simulators' directory contains programs to simulate the protocol
|
|
|
|
of many devices. They are built invoking "make -C simulators/ check"
|
|
|
|
or "make check" from topdir. While simulators are made to test Hamlib
|
|
|
|
with rigctl and rigctld, you should be able to guess the model number
|
|
|
|
that corresponds to a given simulator and configure an application such
|
|
|
|
as wsjtx to use that model and the port name printed by the simulator,
|
|
|
|
as shown in the examples below.
|
|
|
|
|
|
|
|
To use a simulator on *nix-like systems, run its executable and take
|
|
|
|
note of the port name:
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-05-04 08:46:28 +00:00
|
|
|
$ ./simulators/simft991
|
|
|
|
name=/dev/pts/6
|
2025-08-28 13:03:31 +00:00
|
|
|
|
|
|
|
Then from another terminal run rigctl/rigctld using that port and a
|
2025-05-04 08:46:28 +00:00
|
|
|
matching model number (see rigctl --list):
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-05-04 08:46:28 +00:00
|
|
|
$ ./tests/rigctl --model=1035 --rig-file=/dev/pts/6 \get_freq
|
|
|
|
14074000
|
|
|
|
|
|
|
|
To use a simulator on Windows, first install a virtual COM port, then
|
|
|
|
run the simulator passing the port name as first and only argument:
|
2025-08-28 13:03:31 +00:00
|
|
|
|
2025-05-04 08:46:28 +00:00
|
|
|
> simulators\simft991 COM1234
|
2025-08-28 13:03:31 +00:00
|
|
|
|
|
|
|
Then from another command prompt run rigctl/rigctld or your
|
2025-05-04 08:46:28 +00:00
|
|
|
application.
|
|
|
|
|
|
|
|
The COM port argument is currently ignored on *nix but it can be
|
|
|
|
handled if there is a need to test a low level issue with RS-232
|
|
|
|
and/or USB communication, if your machine has the needed hardware.
|
2025-05-03 22:08:44 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
|
2011-06-04 03:58:26 +00:00
|
|
|
8.2.1 Use of rig_debug() function
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Hamlib provides a debugging aid in the form of the rig_debug() function, It is
|
|
|
|
essentially a wrapper around printf() and takes many of the same flags and
|
|
|
|
conversion specifiers as the C library's various printf() functions. It adds an
|
|
|
|
additional parameter for specifying the desired debug level for the output
|
|
|
|
string. Six levels of debugging are defined in include/hamlib/rig.h and they
|
|
|
|
are:
|
2011-06-04 03:58:26 +00:00
|
|
|
|
|
|
|
NONE No bug reporting
|
|
|
|
BUG Serious bug
|
|
|
|
ERR Error case (e.g. protocol, memory allocation)
|
|
|
|
WARN Warning
|
|
|
|
VERBOSE Verbose
|
|
|
|
TRACE Tracing
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
They correspond to the use of the -v switch (from no -v switch to -vvvvv) to
|
|
|
|
rigctl's command line. Hamlib applications can also set the debug level via the
|
|
|
|
Hamlib API. From an application's perspective, setting a specific level
|
|
|
|
includes all messages at that level and all at any lower level.
|
2011-06-04 03:58:26 +00:00
|
|
|
|
|
|
|
In the library, passing RIG_DEBUG_ERR to rig_debug() limits display of that
|
2011-12-03 17:31:40 +00:00
|
|
|
message to a level setting of ERR or any higher level. In this case if the
|
2025-08-28 13:03:31 +00:00
|
|
|
application sets the message level to RIG_DEBUG_INFO, the message will not be
|
|
|
|
seen. Use of a given level can show the value of a critical variable without
|
|
|
|
the need of a TRACE level message where it can get lost in the stream of output
|
|
|
|
produced by low-level Hamlib functions.
|
2011-06-04 03:58:26 +00:00
|
|
|
|
|
|
|
Here are my (N0NB's) suggested use of rig_debug() levels in backends.
|
|
|
|
|
|
|
|
* Many backend functions should have an initial call to rig_debug() as follows:
|
|
|
|
|
2011-12-03 17:31:40 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s() entered\n", __func__);
|
2011-06-04 03:58:26 +00:00
|
|
|
|
|
|
|
The use of RIG_DEBUG_VERBOSE allows tracking the chain of function calls
|
|
|
|
through the backend while still keeping rigctl's output mostly
|
|
|
|
uncluttered by use of the -vvvv switch.
|
|
|
|
|
|
|
|
* Developers will want to call rig_debug() to display values of critical
|
2011-12-03 17:31:40 +00:00
|
|
|
variable(s) in a backend function. For this RIG_DEBUG_VERBOSE
|
|
|
|
(rigctl -vvvv) should be a good choice as the output won't be lost in the
|
|
|
|
stream of RIG_DEBUG_TRACE (rigctl -vvvvv) level output by various
|
|
|
|
low-level Hamlib functions. It will also match the display of the values
|
|
|
|
of critical variable(s) with the function calls as above.
|
2011-06-04 03:58:26 +00:00
|
|
|
|
|
|
|
* Use RIG_DEBUG_TRACE when it makes sense to see the variable(s) in the
|
|
|
|
context of a lot of low-level debugging output (rigctl -vvvvv).
|
|
|
|
|
|
|
|
* Lower levels (BUG, ERR, and WARN) should be used where it makes sense that
|
|
|
|
information be printed when the user selects less verbosity. Use sparingly.
|
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
Many backends do not conform to this suggestion at the moment. The use of the
|
|
|
|
RIG_DEBUG_LEVEL values has been somewhat haphazard (at least by this scribe) so
|
|
|
|
fixing these when working in a given backend is encouraged.
|
2011-06-04 03:58:26 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
If an application sets the debugging level to RIG_DEBUG_NONE, then rig_debug()
|
|
|
|
functions will produce no output. Therefore rig_debug() cannot be counted on to
|
|
|
|
output a message in all runtime cases.
|
2011-06-04 03:58:26 +00:00
|
|
|
|
2012-10-10 02:16:13 +00:00
|
|
|
The debugging levels may be an area for consideration in Hamlib 3.
|
2011-12-03 17:31:40 +00:00
|
|
|
|
2011-06-04 03:58:26 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
8.3 Submitting patches
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
The forges have their own methods of submitting patches as outlined in Section 1
|
|
|
|
above.
|
|
|
|
|
|
|
|
Git provides tools to generate patches and submit them to the Hamlib developers
|
|
|
|
via email. Use of these tools is preferred as Git allows credit to be given to
|
|
|
|
the author and submitter of the patches. Alternately, patches can be submitted
|
|
|
|
in unified format (diff -u), against the Git master branch or a given release
|
|
|
|
(please note well which one!). Both formats make patches easily readable. The
|
|
|
|
patches are to be sent to the hamlib-developer mailing list
|
|
|
|
(hamlib-developer@lists.sourceforge.net). If the file is too big, you can send
|
|
|
|
it as a compressed attachment.
|
2011-04-03 13:52:46 +00:00
|
|
|
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2008-01-06 14:38:37 +00:00
|
|
|
8.3.1 Changelog
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2016-02-14 19:06:11 +00:00
|
|
|
A ChangeLog file is no longer manually maintained. At some point it may be
|
|
|
|
automatically generated from the Git commit log for source tarballs.
|
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
Simply summarize your changes when the files are committed to Git or, if
|
2025-08-28 13:03:31 +00:00
|
|
|
providing patches to the mailing list, provide a summary so the committer can
|
2011-04-03 13:52:46 +00:00
|
|
|
include it in the commit message which will show in the commit log (Git
|
2012-10-10 02:16:13 +00:00
|
|
|
formatted emails will include this already).
|
2011-04-03 13:52:46 +00:00
|
|
|
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
8.4 Git commit access
|
2005-03-25 22:27:32 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
The work flow of the forges greatly diminishes the need for multiple developers
|
|
|
|
having "push" access to the main repository. In practice this works well as it
|
|
|
|
gives an opportunity for manual code review before being merged into "master".
|
2010-04-16 22:14:10 +00:00
|
|
|
|
2025-08-28 13:03:31 +00:00
|
|
|
We do have simple rules that need to be followed:
|
2008-01-06 14:38:37 +00:00
|
|
|
|
2011-04-03 13:52:46 +00:00
|
|
|
* Always keep the Git repository (all branches) in a compilable state.
|
2008-01-06 14:38:37 +00:00
|
|
|
* Follow the coding guidelines
|
2010-04-16 22:14:10 +00:00
|
|
|
* Touching the frontend (files in src/ and include/hamlib) always
|
2008-01-06 14:38:37 +00:00
|
|
|
requires discussion beforehand on the hamlib-developer list.
|
|
|
|
* Announce on the hamlib-developer list if you're about to do serious
|
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
|
|
|
maintenance work
|
2008-01-06 14:38:37 +00:00
|
|
|
|
|
|
|
Thanks for contributing and have fun!
|
2005-03-25 22:27:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-07 21:57:57 +00:00
|
|
|
Stephane Fillod f8cfe and The Hamlib Group
|