blob: dc9cdbe43396a7e81e87d3747954d236e41d5f56 [file] [log] [blame]
James Feist8fd8a582018-11-16 11:10:46 -08001#pragma once
2
3#include <Thresholds.hpp>
4#include <sdbusplus/asio/object_server.hpp>
5
James Feist1169eb42018-10-31 10:08:47 -07006constexpr size_t sensorFailedPollTimeMs = 5000;
James Feist8fd8a582018-11-16 11:10:46 -08007struct Sensor
8{
James Feistdc6c55f2018-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 Feist8fd8a582018-11-16 11:10:46 -080015 virtual ~Sensor() = default;
James Feistdc6c55f2018-10-31 12:53:20 -070016 std::string name;
17 std::string path;
James Feist8fd8a582018-11-16 11:10:46 -080018 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};