Skip to content

Instantly share code, notes, and snippets.

@airween
Created November 19, 2018 20:05
Show Gist options
  • Save airween/90836b788868e94278ced41472ea59a8 to your computer and use it in GitHub Desktop.
Save airween/90836b788868e94278ced41472ea59a8 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <hamlib/rig.h>
int main() {
RIG * my_rig;
int retcode;
vfo_t vfo;
rig_set_debug(RIG_DEBUG_NONE);
my_rig = rig_init(RIG_MODEL_NETRIGCTL);
retcode = rig_open(my_rig);
if (retcode == RIG_OK) {
printf("connected\n");
retcode = rig_get_vfo(my_rig, &vfo);
if (retcode == RIG_OK) {
retcode = rig_set_vfo(my_rig, vfo);
if (retcode == RIG_OK) {
printf("set vfo success\n");
printf("current vfo: %d\n", (int)vfo);
retcode = rig_send_morse(my_rig, vfo, "TEST HA2OS HA2OS TEST");
if (retcode == RIG_OK) {
printf("send success\n");
}
else {
printf("send morse failed, retcode: %d", retcode);
}
}
else {
printf("set vfo failed, retcode: %d\n", retcode);
}
}
else {
printf("can't read current vfo, retcode: %d", retcode);
}
}
else {
printf("cat't connect to rig, retcode: %d\n", retcode);
}
}
all:
gcc -Wall -O0 -g -o hamlibcheck hamlibcheck.c -lhamlib
clean:
rm -f hamlibcheck
@airween
Copy link
Author

airween commented Nov 19, 2018

  • run make
  • open a new terminal
  • run rigctld -m 1 -vv
  • run hamlibcheck binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment