This is a golang binding for Hamlib. The binding has been hand written in order to provide a golang idiomatic API but staying also close as possible to hamlib's C API. Except of Hamlib (C), goHamlib has no other external dependencies.
goHamlib is compatible with both, Hamlib 1.2.x and 3.x.
You might also want to checkout gorigctl which is a drop-in replacement for hamlib's rigctl, although it comes with a cli GUI and a modern, open network interface (implementing the shackbus specification using protocol buffers and MQTT).
Currently, goHamlib covers about 80% of the hamlib API. Basically (the rarely used) Channel API is still missing.
goHamlib has been tested on the following platforms:
- AMD64
- i386
- ARMv7 (e.g. Raspberry Pi 2)
- ARMv8 (e.g. Raspberry Pi 3)
and the following operating Systems:
- Linux (Ubuntu, Raspian, Armbian)
- MacOS (Sierra)
- Windows 10
This library is published under the permissive MIT license. Although please keep in mind that Hamlib is published under the LGPL license.
goHamlib depends on Hamlib which can be either installed through your OS packet manager or easily build from source. If you want the latest patches and support for the latest rigs, you might want to compile the latest stable release or directly from the git repository.
Make sure that you have installed the latest release of Go and set the GOPATH environment variable.
$ sudo apt-get install -y libhamlib2 libhamlib-dev
You can install the hamlib package through homebrew
$ brew install hamlib
$ go get github.com/dh1tw/goHamlib
Most of goHamlib's API is unit tested. In order to execute the unit tests, run:
$ cd $GOPATH/src/github.com/dh1tw/goHamlib
$ go test
goHamlib's API is documented at go.dev
Checkout the dummyrig_test.go in this repository to see how to use goHamlib.