code: public DevState dev_state() throws DevFailed {
  	if (device_state.value() == DevState._ON || device_state.value() == DevState._ALARM) {
  
  	    //
  	    // Read the hardware
  	    //
  
  	    final Vector attr_list = dev_attr.get_alarm_list();
  	    final int nb_wanted_attr = attr_list.size();
  	    if (nb_wanted_attr != 0) {
  		read_attr_hardware(attr_list);
  
  		//
  		// Set attr value
  		//
  
  		int i;
  		for (i = 0; i < nb_wanted_attr; i++) {
  		    final Attribute att = dev_attr
  			    .get_attr_by_ind((Integer) attr_list.elementAt(i));
  		    att.wanted_date(false);
  		    try {
  			read_attr(att);
  		    } catch (final DevFailed ex) {
  			att.wanted_date(true);
  			throw ex;
  		    }
  		    att.wanted_date(true);
  		}
  
  		//
  		// Check alarm level
  		//
  
  		if (dev_attr.check_alarm() == true) {
  		    device_state = DevState.ALARM;
  		}
  
  	    }
  	}
  	return device_state;
      }
docs: Get device state.
  
  Default method to get device state. The behaviour of this method depends
  on the device state. If the device state is ON or ALARM, it reads the
  attribute(s) with an alarm level defined, check if the read value is
  above/below the alarm and eventually change the state to ALARM, return
  the device state. For all th eother device state, ti smethod simply
  returns the state This method can be redefined in sub-classes in case of
  the default behaviour does not fullfill the needs
  
  @return The device state
  @exception DevFailed
  If it is necessary to read attribute(s) and a problem
  occurs during the reading. Click <a
  href="../../tango_basic/idl_html/Tango.html#DevFailed"
  >here</a> to read <b>DevFailed</b> exception specification