Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Ice/Ice.h>
- #include <gnuradio.h>
- using namespace std;
- int main(int argc, char* argv[])
- {
- int status = 0;
- Ice::CommunicatorPtr ic;
- GNURadio::KnobIDList empty_list; // vector<string>
- GNURadio::KnobPropMap knob_props; // map<string, GNURadio::KnobProp>
- GNURadio::KnobMap knob_map; // map<string, GNURadio::KnobPtr>
- try
- {
- // Get proxy object
- ic = Ice::initialize(argc, argv);
- Ice::ObjectPrx base = ic->stringToProxy("gnuradio:tcp -h localhost -p 43243");
- GNURadio::ControlPortPrx ctrlport = GNURadio::ControlPortPrx::checkedCast(base);
- if (!ctrlport)
- throw "Invalid proxy";
- // Get list of knobs
- knob_map = ctrlport->get(empty_list);
- GNURadio::KnobPtr knob = knob_map["strx_source_c0::Frequency"];
- GNURadio::KnobDPtr knobd = static_cast<GNURadio::KnobDPtr>(knob); // GCC error
- }
- catch (const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = 1;
- }
- catch (const char* msg)
- {
- cerr << msg << endl;
- status = 1;
- }
- if (ic)
- ic->destroy();
- return status;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement