From 2a321be376dbc3c534d3634fdcaf141aff79cd48 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 29 Jun 2022 09:57:20 +0100 Subject: ipa: raspberrypi: Add sensor temperature to DeviceStatus Add an optional sensor_temperature field to the DeviceStatus structure. If a temperature measurement is available for a frame, the value is returned out through the SensorTemperature control in the Request metadata. Additionally, provide the sensor temperature value from the std::ostream &operator<< overload. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: David Plowman Signed-off-by: Kieran Bingham --- src/ipa/raspberrypi/controller/device_status.cpp | 3 +++ src/ipa/raspberrypi/controller/device_status.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/ipa/raspberrypi/controller') diff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp index f052ea8b..05897fc1 100644 --- a/src/ipa/raspberrypi/controller/device_status.cpp +++ b/src/ipa/raspberrypi/controller/device_status.cpp @@ -17,5 +17,8 @@ std::ostream &operator<<(std::ostream &out, const DeviceStatus &d) << " Lens: " << d.lens_position << " Flash: " << d.flash_intensity; + if (d.sensor_temperature) + out << " Temperature: " << *d.sensor_temperature; + return out; } diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h index c4a5d9c8..eca3bf4b 100644 --- a/src/ipa/raspberrypi/controller/device_status.h +++ b/src/ipa/raspberrypi/controller/device_status.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include @@ -36,4 +37,6 @@ struct DeviceStatus { double aperture; /* proportional to brightness with 0 = no flash, 1 = maximum flash */ double flash_intensity; + /* Sensor reported temperature value (in degrees) */ + std::optional sensor_temperature; }; -- cgit v1.2.1