blob: dc9cdbe43396a7e81e87d3747954d236e41d5f56 [file] [log] [blame]
James Feistaf79dd32018-09-12 12:54:15 -07001#pragma once
2
3#include <Thresholds.hpp>
4#include <sdbusplus/asio/object_server.hpp>
5
James Feist3452f0e2018-10-31 10:08:47 -07006constexpr size_t sensorFailedPollTimeMs = 5000;
James Feistaf79dd32018-09-12 12:54:15 -07007struct Sensor
8{
James Feist39132a62018-10-31 12:53:20 -07009 Sensor(const std::string& name, const std::string& path,
10 std::vector<thresholds::Threshold>&& thresholdData) :
11 name(name),
12 path(path), thresholds(std::move(thresholdData))
13 {
14 }
James Feistaf79dd32018-09-12 12:54:15 -070015 virtual ~Sensor() = default;
James Feist39132a62018-10-31 12:53:20 -070016 std::string name;
17 std::string path;
James Feistaf79dd32018-09-12 12:54:15 -070018 std::vector<thresholds::Threshold> thresholds;
19 std::shared_ptr<sdbusplus::asio::dbus_interface> sensorInterface;
20 std::shared_ptr<sdbusplus::asio::dbus_interface> thresholdInterfaceWarning;
21 std::shared_ptr<sdbusplus::asio::dbus_interface> thresholdInterfaceCritical;
22 double value = std::numeric_limits<double>::quiet_NaN();
23};