The camera has a built-in temperature sensor to read the internal temperature inside the case. The measuring range is -55°C up to 125°C with a resolution of 0.5°C. Temperature may be read out at shell level by the following command:
~ $ cat /proc/temp 36.5 ~ $
Applications should use this file-based mechanism, too. There is no API call to read out temperature.
Using the temperature sensor may be very useful when using the camera in hot surroundings. When reaching temperatures above 75°C the camera should be shut down.
Note, that temperature conversion in the chip takes up to 750ms.