diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 7e3619ac8..6fc58d71d 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -1396,8 +1396,6 @@ static int ft817_set_vfo(RIG *rig, vfo_t vfo) return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_VFOAB); } - - static int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { unsigned char data[YAESU_CMD_LENGTH - 1]; diff --git a/rigs/yaesu/ft817.h b/rigs/yaesu/ft817.h index 0e23be2e2..475d74c01 100644 --- a/rigs/yaesu/ft817.h +++ b/rigs/yaesu/ft817.h @@ -75,7 +75,6 @@ */ #define FT817_CACHE_TIMEOUT 50 - int ft817_set_powerstat(RIG *rig, powerstat_t status); int ft817_read_ack(RIG *rig); diff --git a/tests/simple.c b/tests/simple.c new file mode 100644 index 000000000..165f4ec5f --- /dev/null +++ b/tests/simple.c @@ -0,0 +1,45 @@ +// Example of rig_get_rig_info +// gcc -o simple simple.s -lhamlib + +#include + +int main(int argc, char *argv[]) +{ + rig_model_t model = 1; + RIG *rig; + + rig_set_debug_level(RIG_DEBUG_WARN); + rig = rig_init(model); + + if (rig == NULL) + { + fprintf(stderr, "rig_init failed\n"); + return 1; + } + + int retcode = rig_open(rig); + + if (retcode != RIG_OK) + { + fprintf(stderr, "rig_open failed: %s\n", rigerror(retcode)); + return 1; + } + + char riginfo[1024]; + retcode = rig_get_rig_info(rig, riginfo, sizeof(riginfo)); + + if (retcode != RIG_OK) + { + fprintf(stderr, "rig_get_rig_info failed: %s\n", rigerror(retcode)); + return 1; + } + + char vfo[16]; + char mode[16]; + double freq; + sscanf(riginfo, "VFO=%s Freq=%lf Mode=%s", vfo, &freq, mode); + printf("VFO=%s Freq=%.0f Mode=%s\n", vfo, freq, mode); + printf("=========================\nEntire response:\n%s", riginfo); + rig_close(rig); + return 0; +}