Re: Sensor readings
Re: Sensor readings
- Subject: Re: Sensor readings
- From: Shawn Erickson <email@hidden>
- Date: Thu, 8 Jan 2004 08:06:34 -0800
On Jan 7, 2004, at 11:25 PM, Kory T wrote:
Hi,
I've been trying to figure out where the readings for the G5 temp
sensors can be located (also for Xserves). I'm assuming OS X has this
info in a way where I can just 'cat' it (since everything on nix is
treated as a file). Or is there a framework that I'm not aware of
that allows me to access this info (still new to programming on OS X
;)? Can someone point me to the right direction?
I hopefully can get on the path at least... (don't know that answer
myself at the moment)
Try running the following command: "ioreg -b -n IOHWSensor"
You will see entries like the following...
| | | | +-o temp-sensor <class IOService, registered,
matched, active, busy 0, retain count 6>
| | | | +-o IOHWSensor <class IOHWSensor, registered,
matched, active, busy 0, retain count 6>
| | | | {
| | | | "current-value" = 1847296
| | | | "polling-period" = 18446744073709551615
| | | | "location" = "DRIVE BAY"
| | | | "type" = "temperature"
| | | | "IOClass" = "IOHWSensor"
| | | | "IONameMatched" = "temp-sensor"
| | | | "version" = 1
| | | | "zone" = <00000001>
| | | | "IOProbeScore" = 0
| | | | "IOMatchCategory" = "IODefaultMatchCategory"
| | | | "IONameMatch" =
("temp-sensor","voltage-sensor","current-sensor","power-sensor","adc-
sensor","fanspeed-sensor")
| | | | "CFBundleIdentifier" =
"com.apple.driver.AppleHWSensor"
| | | | "IOProviderClass" = "IOService"
| | | | "sensor-id" = 4
| | | | }
Using IOKit methods you can scan the IO registry programatically to
find the above information (see IOKit / Kernel document on Apples
developer site). You can also get a hold of the driver instances
(instances of IOHWSensor) which may or may not provide a user client
that will allow you directly communication with whatever API it
exposes. I don't know the units or encoding for current-value...
Also sysclt may exist for the above information... (I don't know myself)
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.