UDP send
by lokal1 from LinuxQuestions.org on (#5N2KG)
Hi,
Newbie here, the only knowledge I have is from googling.
Please bear with me.
How does one properly send data over UDP?
I have a data like this:
Code:typedef union {
struct {
uint8_t buffer[BUFF_SIZE]; // 64
} tx;
struct {
int32_t header;
volatile int32_t Cmd[COMMAND_SIZE]; // 4
float setPoint[VARIABLES]; // 6
uint8_t enable;
uint8_t outputs;
uint8_t spar0;
uint8_t spar1;
} data;
} txData_t;
txData_t txData;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.
Newbie here, the only knowledge I have is from googling.
Please bear with me.
How does one properly send data over UDP?
I have a data like this:
Code:typedef union {
struct {
uint8_t buffer[BUFF_SIZE]; // 64
} tx;
struct {
int32_t header;
volatile int32_t Cmd[COMMAND_SIZE]; // 4
float setPoint[VARIABLES]; // 6
uint8_t enable;
uint8_t outputs;
uint8_t spar0;
uint8_t spar1;
} data;
} txData_t;
txData_t txData;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.