6

My question is very similar to this one: iPhone Proximity Sensor. There's clearly some manner of thermometer within the iPhone that's readable by the OS. Has anyone uncovered the super-secret undocumented APIs to read this sensor?

Community
  • 1
  • 1
Kevin L.
  • 4,548
  • 7
  • 39
  • 54
  • you wouldn't be able to use this api in an app for the app store though... – zpesk Jul 03 '09 at 00:23
  • Absolutely. Apple would be unlikely to accept an app that uses undocumented APIs from anyone but Google, but this is just for sheer curiosity and coding fun. And perhaps in the next big iteration of the SDK Apple will bless this mysterious temperature API for app store use. – Kevin L. Jul 03 '09 at 00:28
  • 2
    There is plenty of market for jailbroken phones. the app store is not the only game in town. – Tim Jul 03 '09 at 01:59
  • Have you made any progress with this? I'd buy it. – Tim Nov 11 '09 at 18:55
  • @tim - No progress. But I haven't been poking around for this particular iPhone OS facet since I asked this question. *Maybe* there's an API or workaround now, four months later? – Kevin L. Nov 12 '09 at 16:24
  • 1
    there is some mention of "temperature" in IOKit: https://github.com/kennytm/iphone-private-frameworks/ but I'm not familiar enough with IOKit to know how to use it, if that's even what we're looking for. – Abhi Beckert May 26 '11 at 10:51

4 Answers4

4

I doubt this sensor is for ambient temperature - rather I suspect it is for overheating of the circuits. If that is all you want then great, but again, I think it would be useless for ambient temperature.

just my opinion.

Tim
  • 20,184
  • 24
  • 117
  • 214
  • 1
    I agree. And I sure wouldn't control my air conditioner with this sensor's output. But because the iPhone is just a mere phone with low power passively cooled electronics, its thermometer should report a temperature close to ambient. Throw in an averaged offset and you've got a temperature reading that's *good enough*. – Kevin L. Jul 03 '09 at 02:29
3

All i could find was CTGetTemperature in CoreTelephony of all places.

valexa
  • 4,462
  • 32
  • 48
2

I don't know about previous models, but my iPhone4 goes from cool-ish to very warm in a matter of minutes depending on the various radio usages. So unless "good enough" = "within 20 degrees F or so", then probably not good for ambient measurement.

Unless (maybe you meant this) you could also track radio usage and subtract a temperature variable depending on radio usages. phew. complicated. Easier to just query NWS.

1

command to get all super-secret names which related with temperature in CoreTelephony framework

nm "/Applications/Xcode463.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/6.1 (10B141)/Symbols/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony" | grep empera

Maxim Kholyavkin
  • 4,463
  • 2
  • 37
  • 82