When receiving dynamic machine data, check if not too much data has been
received: copy only as much data as possible.
This commit is contained in:
parent
0dc38d8908
commit
c8d7f2f904
@ -1042,9 +1042,19 @@ char T_datif::loadRecDataFromFrame()
|
|||||||
epi_setDcDataValid(); // DC-Data are valid as DC responded.
|
epi_setDcDataValid(); // DC-Data are valid as DC responded.
|
||||||
// Could be set to every response but this (31)
|
// Could be set to every response but this (31)
|
||||||
// is a very common and very important request
|
// is a very common and very important request
|
||||||
gpi_storeDynMachineConditions(RdDleng, receivedData);
|
|
||||||
|
|
||||||
gpi_storeDI_CoinAttach(receivedData[6]); // new, 14.2.24 needed for direct coin insertion
|
if (RdDleng > sizeof(struct T_dynamicCondition)) {
|
||||||
|
qCritical() << "!!!WARNING!!! RdDlen too high" << RdDleng;
|
||||||
|
// only use as many bytes as maximally possible
|
||||||
|
char buf[sizeof(struct T_dynamicCondition)];
|
||||||
|
memset(buf, 0, sizeof(buf));
|
||||||
|
memcpy(buf, receivedData, sizeof(struct T_dynamicCondition));
|
||||||
|
gpi_storeDynMachineConditions(buf);
|
||||||
|
} else {
|
||||||
|
gpi_storeDynMachineConditions(receivedData);
|
||||||
|
}
|
||||||
|
|
||||||
|
gpi_storeDI_CoinAttach(((struct T_dynamicCondition *)receivedData)->coinAttached); // new, 14.2.24 needed for direct coin insertion
|
||||||
|
|
||||||
}
|
}
|
||||||
/* funktioniert, ist aber nicht nötig. Signal wird nach dem shared memory erzeugt
|
/* funktioniert, ist aber nicht nötig. Signal wird nach dem shared memory erzeugt
|
||||||
|
Loading…
Reference in New Issue
Block a user