public DeviceControllerDeviceStatus getDeviceStatus ( ) throws IOException { // get status from device int deviceStatus = read ( MEMADDR_STATUS ) ; // check formal criterias int reservedValue = deviceStatus & STATUS_RESERVED_MASK ; if ( reservedValue != STATUS_RESERVED_VALUE ) { throw new IOException ( "status-bits 4 to 8 must be 1 according to documentation chapter 4.2.2.1. got '" + Integer . toString ( reservedValue , 2 ) + "'!" ) ; } // build the result boolean eepromWriteActive = ( deviceStatus & STATUS_EEPROM_WRITEACTIVE_BIT ) > 0 ; boolean eepromWriteProtection = ( deviceStatus & STATUS_EEPROM_WRITEPROTECTION_BIT ) > 0 ; boolean wiperLock0 = ( deviceStatus & STATUS_WIPERLOCK0_BIT ) > 0 ; boolean wiperLock1 = ( deviceStatus & STATUS_WIPERLOCK1_BIT ) > 0 ; return new DeviceControllerDeviceStatus ( eepromWriteActive , eepromWriteProtection , wiperLock0 , wiperLock1 ) ; }
Returns the status of the device according EEPROM and WiperLocks .