But I simply can't find an easy enough example to understand how message passing works. So I tried to create two simple blocks in order to better understand this system. I simply wanted a block that would receive a stream (not neccesarily tagged) of bytes and then post them as a message. The other one would receive this message and then output the same stream of bytes. I know there are message source/sink blocks that do this, but as I understand, they work on a previous message passing system.
for(int i = 0; i < noutput_items; i++) { while(!rx_check); out[i] = buffer[i]; } return noutput_items; }
As far as I understand, this could be the simplest case to send bytes through messages. But I feel there is something wrong, as the pmt doesn't seem to have a method to deal with chars, so I have to do lots of conversions. Still, this didn't seem to be a reason of bigger concerns.
My python QA block simply does a message connect between their message ports. But when I try to run the test, the tb simply freezes and I have to finish with ctrl+C.
Is there any easier way to implement message passing?