You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of MockSpi.transfer() doesn't read or write to the data buffer. That makes it impossible for the tester to provide mock data.
For reference, the current implementation:
@Overridepublicinttransfer(byte[] write, intwriteOffset, byte[] read, intreadOffset, intnumberOfBytes) {
intreadIndex = readOffset;
// simply just echo out the write data back to the read buffer <<<<<<<<<<-- that's the problem -MNGfor(intn = writeOffset; n < numberOfBytes - writeOffset; n++){
read[readIndex] = write[n];
readIndex++;
}
// return number of byte returnedreturnreadIndex - readOffset;
}
The text was updated successfully, but these errors were encountered:
https://github.com/Pi4J/pi4j-v2/blob/8d8f1574f926dfd2961356cf015dcbd58e50664e/plugins/pi4j-plugin-mock/src/main/java/com/pi4j/plugin/mock/provider/spi/MockSpi.java#L84
The current implementation of MockSpi.transfer() doesn't read or write to the data buffer. That makes it impossible for the tester to provide mock data.
For reference, the current implementation:
The text was updated successfully, but these errors were encountered: