mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
adapted AsyncIP for new endianess
This commit is contained in:
parent
a3222da312
commit
df0ee8d98a
1 changed files with 3 additions and 4 deletions
|
@ -139,6 +139,8 @@ static void *SendToIPPort(void *arg)
|
|||
msg.sequence = seq++;
|
||||
msg.ts.sec = now.tv_sec;
|
||||
msg.ts.nsec = now.tv_nsec;
|
||||
|
||||
msg_hton(msg);
|
||||
|
||||
/* Perform the actual write to the ip port */
|
||||
if (SendPacket((char *) &msg, MSG_LEN(&msg)) < 0)
|
||||
|
@ -207,16 +209,13 @@ static void *RecvFromIPPort(void *arg)
|
|||
OpalPrint("%s: Received message with unknown version. Skipping..\n", PROGNAME);
|
||||
continue;
|
||||
}
|
||||
msg_ntoh(msg);
|
||||
|
||||
if (msg.type != MSG_TYPE_DATA) {
|
||||
OpalPrint("%s: Received no data. Skipping..\n", PROGNAME);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Convert message to host endianess */
|
||||
if (msg.endian != MSG_ENDIAN_HOST)
|
||||
msg_swap(&msg);
|
||||
|
||||
if (n != MSG_LEN(&msg)) {
|
||||
OpalPrint("%s: Received incoherent packet (size: %d, complete: %d)\n", PROGNAME, n, MSG_LEN(&msg));
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue