From 942de4b6f41906d26a99175ab2d8f53ca3d5cb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Sun, 8 Oct 2000 21:48:52 +0000 Subject: [PATCH] added dynamic loading support, and rig_get_strength call git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@200 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- tests/testrig.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/testrig.c b/tests/testrig.c index d8cc61248..f219b5c78 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -2,7 +2,7 @@ * Hamlib sample program */ -#include +#include #include #include @@ -14,6 +14,7 @@ int main () freq_t freq; /* frequency */ rmode_t rmode; /* radio mode of operation */ vfo_t vfo; /* vfo selection */ + int strength; /* S-Meter level */ int retcode; /* generic return code from functions */ @@ -23,6 +24,12 @@ int main () * allocate memory, setup & open port */ + retcode = rig_load_backend("icom"); + if (retcode != RIG_OK ) { + printf("rig_load_backend: error = %s \n", rigerror(retcode)); + exit(3); + } + my_rig = rig_init(RIG_MODEL_IC706MKIIG); if (!my_rig) exit(1); /* whoops! something went wrong (mem alloc?) */ @@ -93,6 +100,15 @@ int main () printf("rig_get_mode: error = %s \n", rigerror(retcode)); } + retcode = rig_get_strength(my_rig, &strength); + + if (retcode == RIG_OK ) { + printf("rig_get_strength: strength = %i \n", strength); + } else { + printf("rig_get_strength: error = %s \n", rigerror(retcode)); + } + + rig_close(my_rig); /* close port */ rig_cleanup(my_rig); /* if you care about memory */