getI2CerrorCode static method
Converts the native error code value
to I2CerrorCode.
Implementation
static I2CerrorCode getI2CerrorCode(int value) {
// must be negative
if (value >= 0) {
return I2CerrorCode.errorCodeNotMappable;
}
value = -value;
// check range
if (value > I2CerrorCode.i2cErrorClose.index) {
return I2CerrorCode.errorCodeNotMappable;
}
return I2CerrorCode.values[value];
}