2002-01-27 14:45:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Hamlib sample C++ program
|
|
|
|
*/
|
|
|
|
|
2003-04-06 18:30:42 +00:00
|
|
|
#include <iostream>
|
2002-01-27 14:45:52 +00:00
|
|
|
#include <hamlib/rigclass.h>
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2021-07-15 22:26:48 +00:00
|
|
|
Rig myRig {RIG_MODEL_DUMMY};
|
2002-01-27 14:45:52 +00:00
|
|
|
|
|
|
|
try {
|
2010-04-05 10:10:16 +00:00
|
|
|
myRig.setConf("rig_pathname", "/dev/ttyS1");
|
2002-01-27 14:45:52 +00:00
|
|
|
myRig.open();
|
|
|
|
myRig.setFreq(MHz(144));
|
2003-04-06 18:30:42 +00:00
|
|
|
std::cout << myRig.getLevelI(RIG_LEVEL_STRENGTH) << "dB" << std::endl;
|
|
|
|
std::cout << "Modes for freq 14.332: " << myRig.RngRxModes(MHz(14.332)) << std::endl;
|
2002-01-27 14:45:52 +00:00
|
|
|
myRig.close();
|
|
|
|
}
|
|
|
|
catch (const RigException &Ex) {
|
|
|
|
Ex.print();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|