Don not copy frame data to datagram memory, if datagram type is write-only.
--- a/master/master.c Fri Sep 16 09:19:24 2011 +0200
+++ b/master/master.c Fri Sep 16 12:44:54 2011 +0200
@@ -1094,8 +1094,14 @@
continue;
}
- // copy received data into the datagram memory
- memcpy(datagram->data, cur_data, data_size);
+ if (datagram->type != EC_DATAGRAM_APWR &&
+ datagram->type != EC_DATAGRAM_FPWR &&
+ datagram->type != EC_DATAGRAM_BWR &&
+ datagram->type != EC_DATAGRAM_LWR) {
+ // copy received data into the datagram memory,
+ // if something has been read
+ memcpy(datagram->data, cur_data, data_size);
+ }
cur_data += data_size;
// set the datagram's working counter