2 * Copyright (C) 2023 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "GPUInfoPosix.h"
13 bool CGPUInfoPosix::SupportsCustomTemperatureCommand() const
18 bool CGPUInfoPosix::GetGPUTemperatureFromCommand(CTemperature
& temperature
,
19 const std::string
& cmd
) const
26 if (cmd
.empty() || !(p
= popen(cmd
.c_str(), "r")))
31 ret
= fscanf(p
, "%d %c", &value
, &scale
);
39 if (scale
== 'C' || scale
== 'c')
41 temperature
= CTemperature::CreateFromCelsius(value
);
43 else if (scale
== 'F' || scale
== 'f')
45 temperature
= CTemperature::CreateFromFahrenheit(value
);