Idiomatic method to inject data from a non-opencpi source

I have an RCC worker which additionally receives a stream of data from a non-OpenCPI TCP socket. I would like to send this data on via the worker’s outputs to the rest of the OpenCPI application, and I’m wondering if there is an idiomatic way to do this. Should I simply resort to caching the data in a SPSC queue and then outputting it next time worker::run() is invoked? Since the worker will have no OpenCPI inputs, if the queue is empty then run will exit immediately. Presumably this will cause a busy loop (constantly invoking run and exiting with no outputs) and I’m wondering if there is any way to avoid that?

One way accomplish getting data from a non-OpenCPI application into an OpenCPI application is to do so using external ports in an Application Control Interface (ACI) application.

On page 31 of the OpenCPI Application Development Guide you will find more information on implementing this.

Using your the queue should work. The OpenCPI execution environment is polling based , it’s evident when looking at the CPU utilization when executing even the simplest of applications.

1 Like

@aolivarez That’s fantastic, thank you so much for the speedy reply! I will have a read.