Commit Graph

13 Commits

Author SHA1 Message Date
thorpej 033d68f1b3 Add support for light sensors that report Illuminance in lux. 2018-05-27 01:39:00 +00:00
kardel 54c2251d60 add HYT-221/271/939 humidity/temperature I2C sensor
extend envsys(4) framework by %rH (relative humidity)
2014-05-18 11:46:23 +00:00
pgoyette 9687fb7cf2 1. Enable use of FMONSTCHANGED events for INDICATOR sensors
2. Update handling of FMONCRITICAL event reporting.   The state
   transition does not require a corresponding change in value.

With these changes, you can now have an INDICATOR sensor that
reports the presence or absence of a device, and (if the device
is present) separately monitor it for proper functioning.

Should address the concerns expressed recently with the commit
of changes to wmi(4) BBU handling.
2012-08-27 21:42:04 +00:00
nonaka e191e46afa Pass table_id to sme_find_table(). 2011-06-19 05:26:31 +00:00
nonaka fa7cbdd70b fix typo. 2011-06-19 05:17:38 +00:00
christos 3cc7694381 simplify and don't deref NULL. 2011-06-19 04:23:18 +00:00
pgoyette 3b3fd97442 Add routine to lookup description tables by description instead of by
type.
2011-06-19 03:09:43 +00:00
pgoyette e76f489b1b Extract searching of description tables into a single function, rather
than duplicating the code every time.  Minor reduction in code size
(about 1200 bytes on amd64), no change in functionality.
2010-12-15 17:17:16 +00:00
xtraeme 51e43163c8 Add three new values for ENVSYS_DRIVE units:
* ENVSYS_DRIVE_OFFLINE, ENVSYS_DRIVE_CHECK and ENVSYS_DRIVE_BUILD
2008-02-28 16:21:34 +00:00
xtraeme 820f120b52 Add ENVSYS_DRIVE_MIGRATING for ENVSYS_DRIVE sensors, this is for RAID
volumes that are migrating such as when you change the stripe size.

While I'm here use the same string than we had in the old framework to
report status "online" vs "drive is online", because the sensor might be
a RAID volume and not just a drive.
2007-12-07 11:47:49 +00:00
xtraeme 4e10a84855 - Rename ENVSYS_BATTERY_STATE units to ENVSYS_BATTERY_CAPACITY and
introduce ENVSYS_BATTERY_CHARGE, which is the same than an Indicator and
  it's used to know if the battery is currently charging or discharging.

- Require two sensors at least for SME_CLASS_BATTERY to make the low-power
  condition work: a ENVSYS_BATTERY_CAPACITY plus ENVSYS_BATTERY_CHARGE.

- Simplify sme_event_check_lowpower() and make it check the required
  sensors in the SME_CLASS_ACADAPTER and SME_CLASS_BATTERY classes.
  If the acadapter is not ready, trust the state returned by the battery
  device.

Based on suggestion from joerg@.
2007-11-03 23:05:21 +00:00
xtraeme 6c4da82b5e New changes to support the new configuration file format for
envstat(8) and the envsys framework:

- Modify the ENVSYS_SETDICTIONARY ioctl to support the following
  plist structure:

  <dict>
	<key>foo0</key>
	<array>
		<dict>
			<key>index</key>
			<string>sensor0</string>
			<key>description</key>
			<string>cpu temp</string>
			...
			Another property for this sensor
			...
		</dict>
		...
		Another dictionary for other sensor
		...
	</array>
	...
	Another device as above
	...
  </dict>

  Multiple devices with multiple sensors can now be specified, that means
  that to set the properties only one copyin(9) is needed now.

- Added the ENVSYS_REMOVEPROPS ioctl, that accepts a boolean object
  "envsys-remove-props" and when set to true, all properties that were
  set previously by ENVSYS_SETDICTIONARY will be removed. That means that
  you can now set multiple critical limits, descriptions and all they
  will be removed or changed to its default value (for rfact and
  description objects).

- Added the 'index' and 'allow-rfact' objects into the sensor dictionaries,
  for better interactivity with userland. To know the position of the
  sensor and to know if sensor allows to change the rfact.

- Misc cosmetic changes for consistency.

- Use a two clause license for all my code.
2007-10-07 04:11:15 +00:00
xtraeme 5b53183e98 - Remove ENVSYS_GSTRING and the genstr member from envsys_data_t.
(at least three or four persons were against it).
- Add a new sensor type: ENVSYS_BATTERY_STATE, this uses value_cur
  and some predefined values in a static table, like ENVSYS_DRIVE.
- Move all static tables to sysmon_envsys_tables.c and use a function
  on it to retrieve a pointer to the struct of the specified type.
- Rename the ENVSYS_FMONDRVSTCHANGED to ENVSYS_FMONSTCHANGED and make
  it generic for Battery state and drive sensors (this flag enables
  monitoring on these sensors when state has been changed).
- Update sysmon_penvsys_event() to report state changes on
  ENVSYS_BATTERY_STATE sensors and remove other type of events, with
  PENVSYS_EVENT_STATE_CHANGED they are not necessary anymore.
2007-09-04 16:54:02 +00:00