Hamlib/c++/testcpp.cc
Stéphane Fillod, F8CFE 49f0f17a86 more example code
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2866 7ae35d74-ebe9-4afe-98af-79ac388436b8
2010-04-05 10:10:16 +00:00

28 lines
515 B
C++

/*
* Hamlib sample C++ program
*/
#include <iostream>
#include <hamlib/rigclass.h>
int main(int argc, char* argv[])
{
Rig myRig = Rig(RIG_MODEL_DUMMY);
try {
myRig.setConf("rig_pathname", "/dev/ttyS1");
myRig.open();
myRig.setFreq(MHz(144));
std::cout << myRig.getLevelI(RIG_LEVEL_STRENGTH) << "dB" << std::endl;
std::cout << "Modes for freq 14.332: " << myRig.RngRxModes(MHz(14.332)) << std::endl;
myRig.close();
}
catch (const RigException &Ex) {
Ex.print();
return 1;
}
return 0;
}