public Boolean GetColor (out byte r, out byte g, out byte b)
{
if (OnReceiveColor(0, out r, out g, out b))
return true;
byte[] report = new byte[33];
report[0] = 1;
if (connectedToDriver) {
int attempt = 0;
while (attempt < 5)
{
attempt++;
try
{
stream.GetFeature(report, 0, 33);
break;
}
catch
{
if (attempt == 5)
throw;
if (!WaitThread(20))
return false;
}
}
r = report [1];
g = report [2];
b = report [3];
return true;
} else {
r = 0;
g = 0;
b = 0;
return false;
}
}