kopia lustrzana https://github.com/Hamlib/Hamlib
testcpp moved from ../tests
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@913 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.1.3
rodzic
3fc5f29a64
commit
01b565d2b3
|
@ -4,3 +4,9 @@ libhamlib___la_SOURCES = rigclass.cc rotclass.cc
|
||||||
libhamlib___la_LDFLAGS = -no-undefined -release @VERSION@ -version-info 0:0:0
|
libhamlib___la_LDFLAGS = -no-undefined -release @VERSION@ -version-info 0:0:0
|
||||||
libhamlib___la_LIBADD = ../src/libhamlib.la
|
libhamlib___la_LIBADD = ../src/libhamlib.la
|
||||||
|
|
||||||
|
noinst_PROGRAMS = testcpp
|
||||||
|
|
||||||
|
testcpp_SOURCES = testcpp.cc
|
||||||
|
testcpp_LDADD = libhamlib++.la
|
||||||
|
testcpp_LDFLAGS = @BACKENDLNK@
|
||||||
|
testcpp_DEPENDENCIES = libhamlib++.la @BACKENDEPS@
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hamlib sample C++ program
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream.h>
|
||||||
|
#include <hamlib/rigclass.h>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
Rig myRig = Rig(RIG_MODEL_DUMMY);
|
||||||
|
|
||||||
|
try {
|
||||||
|
myRig.open();
|
||||||
|
myRig.setFreq(MHz(144));
|
||||||
|
cout << myRig.getLevelI(RIG_LEVEL_STRENGTH) << "dB" << endl;
|
||||||
|
cout << "Modes for freq 14.332: " << myRig.RngRxModes(MHz(14.332)) << endl;
|
||||||
|
myRig.close();
|
||||||
|
}
|
||||||
|
catch (const RigException &Ex) {
|
||||||
|
Ex.print();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Ładowanie…
Reference in New Issue