# Need help with control port client

**URL:** <https://www.ruby-forum.com/t/need-help-with-control-port-client/227936>\
**Category:** GNU Radio\
**Created:** [April 4, 2013, 1:53am UTC](https://www.ruby-forum.com/t/need-help-with-control-port-client/227936 "2013-04-04T01:53:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![copot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@copot](https://www.ruby-forum.com/u/copot)\
**Post date:** [April 4, 2013, 1:53am UTC](https://www.ruby-forum.com/t/need-help-with-control-port-client/227936/1 "2013-04-04T01:53:43Z")

</div>

Greetings,

I’m trying to write a control port client in C++ but I got stuck and  
need some help.

My problem is that the control port interface gives us a map  
containing GNURadio::KnobPtr but to get access to the value I need a  
typed pointer, e.g. GNURadio::KnobDPtr, which is derived from KnobPtr.  
I tried a static\_cast as illustrated in this snippet:  
[gr-ctrlport client - Pastebin.com](http://pastebin.com/NqWyqSeu) - but gcc throws it right back at me with  
an error:

In file included from /usr/include/Ice/LocalObjectF.h:15:0,  
from /usr/include/Ice/CommunicatorF.h:24,  
from /usr/include/Ice/Initialize.h:13,  
from /usr/include/Ice/Ice.h:13,  
from strx-mon.cpp:1:  
/usr/include/Ice/Handle.h: In constructor  
IceInternal::Handle::Handle(const IceInternal::Handle&) [with Y  
= GNURadio::Knob, T = GNURadio::KnobD]:  
strx-mon.cpp:28:72: instantiated from here  
/usr/include/Ice/Handle.h:73:9: error: invalid conversion from  
GNURadio::Knob\* to GNURadio::KnobD\* [-fpermissive]

Maybe I’m approaching it all wrong. In any case, I would appreciate  
any hints I can get.

Alex

---

<div class="post-metadata">

**Author:** ![copot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@copot](https://www.ruby-forum.com/u/copot)\
**Post date:** [April 5, 2013, 12:38am UTC](https://www.ruby-forum.com/t/need-help-with-control-port-client/227936/2 "2013-04-05T00:38:10Z")

</div>

On Thu, Apr 4, 2013 at 1:52 AM, Alexandru C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> an error:  
> /usr/include/Ice/Handle.h:73:9: error: invalid conversion from  
> GNURadio::Knob\* to GNURadio::KnobD\* [-fpermissive]

Sorry for the noise. I realized that adding -fpermissive to gcc will  
make it compile and run as expected. I guess I can now look forward to  
being publicly crucified at the next C++ convention… On the other  
hand the Python does the same thing behind the scenes so I will not  
loose any sleep over this.

Alex

---

<div class="post-metadata">

**Author:** ![copot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@copot](https://www.ruby-forum.com/u/copot)\
**Post date:** [April 5, 2013, 12:42am UTC](https://www.ruby-forum.com/t/need-help-with-control-port-client/227936/3 "2013-04-05T00:42:16Z")

</div>

On Thu, Apr 4, 2013 at 6:37 PM, Alexandru C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > [gr-ctrlport client - Pastebin.com](http://pastebin.com/NqWyqSeu) - but gcc throws it right back at me with  
> > strx-mon.cpp:28:72: instantiated from here  
> > Alex  
> > Alex,

That’s nice to know. I was waiting until I had more time to help you  
out with this, but no need.

It’ll be good to have some C++ apps using ControlPort out there for us  
to look at 🙂

Tom
