The following method running on MF4.3R5 return 0 while it should be 0x13.
MF4.2R5 works well
private int ReadByteFromRegister(int register)
{
#if MF_FRAMEWORK_VERSION_V4_2
var writeBuffer = new byte[1];
writeBuffer[0] = (byte)(register | 0x80);
var readBuffer = new byte[1];
if (_sensor.Write(writeBuffer, 0, 1) != writeBuffer.Length)
{
throw new Exception("IO Write error TCS3414");
}
if (_sensor.Read(readBuffer, 0, 1) != readBuffer.Length)
{
throw new Exception("IO Read error TCS3414");
}
return readBuffer[0];
#endif
#if MF_FRAMEWORK_VERSION_V4_3
_sensor.WriteByte((byte) (register | 0x80));
return _sensor.ReadByte();
#endif
}