1
0
Fork 0
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:
Steffen Vogel 2017-04-23 22:15:41 +02:00
parent a3222da312
commit df0ee8d98a

View file

@ -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;