10 #ifndef FCF_DEVMGR_DEVICE_SENSOR_LCSIF_HPP
11 #define FCF_DEVMGR_DEVICE_SENSOR_LCSIF_HPP
14 #include <unordered_map>
17 #include <yaml-cpp/yaml.h>
24 #include <rad/mal/publisher.hpp>
27 namespace fcf::devmgr::sensor {
43 void SetValue(
const fcf::common::Variant value);
70 fcf::common::Variant value);
79 std::unordered_map<std::string, ChannelData>
m_values;
96 template<
typename TOPIC_TYPE = fcfif::SensorTopicUnion>
116 SensorLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
186 void Listener(fcf::common::VectorVariant& params);
193 virtual std::string
GetRpcError(
const short error_code)
const;
205 void PublishState(
const fcf::common::Variant& value);
214 void PublishSubstate(
const fcf::common::Variant& value);
216 void PublishError(
const fcf::common::Variant& value);
218 void PublishChannel(
const std::string channel,
219 const fcf::common::Variant& value);
237 #include "sensorLcsIf.ipp"
239 #endif //FCF_DEVMGR_DEVICE_SENSOR_LCSIF_HPP
void SetValue(const fcf::common::Variant value)
void Listener(fcf::common::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
bool IsHwFailure()
Check if Sensor is in hardware error.
void SetData(const SensorControllerData &data)
Definition: sensorLcsIf.cpp:36
std::string GetErrorText() const
Sensor Local Control System (LCS) Interface (IF) class.
Definition: sensorLcsIf.hpp:97
SensorConfig class header file.
void StopMonitoring()
Stop monitoring of controller attributes.
virtual std::string GetSubstateStr() const
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:31
virtual ~ChannelData()
Definition: sensorLcsIf.cpp:21
friend std::ostream & operator<<(std::ostream &dest, const ChannelData &obj)
Definition: sensorLcsIf.cpp:24
virtual bool IsReady()
Check if controller is in Standby/Ready state.
void GetChannelValue(std::string channel, ChannelData &data)
void SetChannelValue(std::string channel, fcf::common::Variant value)
SensorLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx, bool initialise=true)
sensorLcsIf constructor.
virtual void ReadStatus(SensorControllerData &status)
Read status from the controller.
void GetValue(bool &value) const
virtual std::string GetRpcError(const short error_code) const
virtual bool IsOperational()
Check if controller is in Operational.
void StartMonitoring()
Start monitoring of controller attributes.
The sensorControllerData struct.
Definition: sensorLcsIf.hpp:60
ChannelData()
Definition: sensorLcsIf.cpp:18
void ClearChannelValues()
std::unordered_map< std::string, ChannelData > m_values
Definition: sensorLcsIf.hpp:79
fcf::common::Variant m_value
Definition: sensorLcsIf.hpp:48
DataContext class header file.
Definition: dataContext.hpp:81
std::unique_ptr< rad::cii::Publisher< TOPIC_TYPE > > m_publisher
Definition: sensorLcsIf.hpp:228
SensorControllerData()
Definition: sensorLcsIf.cpp:29
deviceLcsIf class header file.
virtual ~SensorLcsIf()
Default destructor.
Definition: sensorLcsIf.hpp:122
std::unordered_map< std::string, std::string > m_channels_map
Definition: sensorLcsIf.hpp:227
virtual ~SensorControllerData()
Definition: sensorLcsIf.cpp:33
The ChannelData struct.
Definition: sensorLcsIf.hpp:33
virtual bool IsNotReady()
Check if controller is in Standby/NotReady state.
Definition: deviceLcsIf.hpp:72