Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::comms::vdr::VdrMessage Class Referencefinal

This class contains the information of a VDR Message. More...

#include <VdrMessage.hpp>

Inheritance diagram for iv::comms::vdr::VdrMessage:
[legend]
Collaboration diagram for iv::comms::vdr::VdrMessage:
[legend]

Public Member Functions

 VdrMessage (iv::types::timestamp hourOfAlarm, uint16_t alarmId, bool alarmCondition, bool ackState, std::string_view alarmDescription)
 
std::vector< std::byte > serialize () const override
 Serialize the VDR message to be sent through the serial line driver.
 
bool deserialize (const std::vector< std::byte > &input) override
 

Static Private Member Functions

template<typename T >
requires std::is_base_of_v<ISerializable, T>
static std::vector< std::byte > serialize (const T &object)
 

Private Attributes

iv::types::timestamp hourOfAlarm
 
uint16_t alarmId
 
bool alarmCondition
 true for Active, Ack and false for Inactive, Unacknowledged, Undefined
 
bool ackState
 true for Acknowledged, false for everything else
 
std::string_view alarmDescription
 
std::vector< std::byte > bytes
 

Detailed Description

This class contains the information of a VDR Message.

Constructor & Destructor Documentation

◆ VdrMessage()

iv::comms::vdr::VdrMessage::VdrMessage ( iv::types::timestamp hourOfAlarm,
uint16_t alarmId,
bool alarmCondition,
bool ackState,
std::string_view alarmDescription )

Member Function Documentation

◆ deserialize()

bool iv::comms::vdr::VdrMessage::deserialize ( const std::vector< std::byte > & input)
nodiscardoverridevirtual
Note
not implemented, it's not necessary to read vdr messages
Parameters
input
Returns

Implements iv::comms::IMessageComm.

◆ serialize() [1/2]

std::vector< std::byte > iv::comms::vdr::VdrMessage::serialize ( ) const
nodiscardoverridevirtual

Serialize the VDR message to be sent through the serial line driver.

Returns
std::vector<std::byte> with the following format $ERALR,HHMMSS.SSS,alarmId,alarmCondition,ackState,alarmDescription*CC

Implements iv::comms::IMessageComm.

◆ serialize() [2/2]

template<typename T >
requires std::is_base_of_v<ISerializable, T>
static std::vector< std::byte > iv::core::ISerializable::serialize ( const T & object)
inlinestaticinherited

Member Data Documentation

◆ ackState

bool iv::comms::vdr::VdrMessage::ackState
private

true for Acknowledged, false for everything else

◆ alarmCondition

bool iv::comms::vdr::VdrMessage::alarmCondition
private

true for Active, Ack and false for Inactive, Unacknowledged, Undefined

◆ alarmDescription

std::string_view iv::comms::vdr::VdrMessage::alarmDescription
private

◆ alarmId

uint16_t iv::comms::vdr::VdrMessage::alarmId
private

◆ bytes

std::vector<std::byte> iv::comms::IMessageComm::bytes
inherited

◆ hourOfAlarm

iv::types::timestamp iv::comms::vdr::VdrMessage::hourOfAlarm
private

The documentation for this class was generated from the following files: