ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The header is always a fixed data.
Only header and enable has initial value greater than 0,
the rest are 0 values.
I'm sending the whole 64byte buffer over UDP, but I'm only receiving
the header, I'm expecting to also receive the enable value
but it's not there.
What do I need to do to make sure I receive the datas or for that matter
how do I make sure that the datas are actually getting sent.
yes, I just didn't post it.
rxData is a different type/stucture
It belongs to the same code as txData on
the client side.
The other side, the server, where I receive is identical
typedef'ed union as the txData, but named rxData
since its the receiver.
Edit:
Ok maybe it's a bit confusing.
both sides has txData/rxData with identical structure
except it's name is the reverse. The structure of txData on the
client side is identical to server, just on the server side
it's named rxData. Same with the others.
I have just tested it with a simulated server on my PC,
(the actual server is a microcontroller).
Learnt a bit of wireshark, I just found out that in the
(hex view) packet bytes the value '7' is there. Since it's a not printable
value, it's not in the packet details?
I'll investigate further, if you have more input that would be great.
You cannot read the 'enable' field from the 'rxData_t' structure, because it doesn't have such a field. You can find it out if you add more debug-print into your program. Example attached.
The txData/rxData in the posted code is just for the client.
The server also has the txData/rxData. The rxData union of
the server is identical to the txData of the client same
as the txData of the server is identical to rxData of the client.
I've verified the received bytes. It says 64bytes so
I'm getting all the bytes just not sure why not the correct bytes.
If I'm seeing it in wireshark it's being sent, I'll have a
second look at the receiving end.
'figured it out. I wasn't clearing the DMA transfer complete flag.
The client is a RaspberryPi, talking to an STM32F4.
I believe the Rpi can do both endian, but the micro is definitely little ender.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.