Sending Fw::Buffer to Drv::Udp #3079
-
I'm new to Fprime and I'm learning how to use ports. We have a rust driver for our radio that opens a UDP socket that accepts EDL packets and then transmits them. For starters, I just want to be able to test this functionality within fprime using Drv::Udp with server and client threads. I am trying to properly wire the ports to use a FW::Buffer so that my radio component can pass an EDL packet (struct) to the UDP driver. To simplify this, I'm using an array of U8 instead of the edlpacket_t struct (which requires serialization) to get it working. Unfortunately, I'm doing something wrong to set this up since it's asserting: I've been trying to debug this with GDB but it's not breaking and stepping properly in that portion of the code. I would appreciate any help or insight that anyone has to offer. Here is my setup: topology.fpp:
instances.fpp:
OreSatDevTopology.cpp:
...
...
...
Component/Radio/Radio.fpp:
Component/Radio/Radio.hpp
Component/Radio/Radio.cpp:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I think your problem is in Radio.cpp. You're manually constructing a buffer when you should be getting it from your bufferManager's bufferGetCallee port. So instead of:
you should do
then you can send the buffer to the driver, which will send it via a socket and return the buffer to the buffer manager. However, I would note that I'm confunsed why you seem to be declaring a thread entry point:
If you're constructing a separate thread yourself, instead I would recommend using a combination of ActiveRateGroup, LinuxTimer and RateGroupDriver components to run your "udpClientTaskEntry" code on a regular schedule. |
Beta Was this translation helpful? Give feedback.
I think your problem is in Radio.cpp.
You're manually constructing a buffer when you should be getting it from your bufferManager's bufferGetCallee port. So instead of:
you should do