Skip to content

Sending Fw::Buffer to Drv::Udp #3079

Answered by zimri-leisher
chroco asked this question in Q&A
Discussion options

You must be logged in to vote

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:

Fw::Buffer buffer(data, sizeof(data));

you should do

// allocate a buffer from the bufman
FwBuffer buffer = this->allocate_out(0, sizeof(data));
// check if allocation of sufficient mem failed
if (buffer.getSize() < sizeof(data)) {
    FW_ASSERT(0, buffer.getSize(), sizeof(data));
}
// write the data into the buffer
// args are: U8* arr, len of the arr, and True to stop the serialize method from writing the len of the array into the buf
Fw::SerializeStatus stat = buffer.serialize(data, sizeof(data), True);
FW_ASSERT(stat …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@zimri-leisher
Comment options

@chroco
Comment options

@zimri-leisher
Comment options

@chroco
Comment options

Answer selected by chroco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants