blob: 23238e873672ab65dbdafac49c5c2d7f77459b6a [file] [log] [blame]
Ben Tynerf5210bb2021-01-05 12:58:10 -06001#include "user_header.hpp"
2
3namespace attn
4{
5namespace pel
6{
7
8UserHeader::UserHeader(Stream& pel)
9{
10 unflatten(pel);
11}
12
13void UserHeader::flatten(Stream& stream) const
14{
15 stream << _header << _eventSubsystem << _eventScope << _eventSeverity
16 << _eventType << _reserved4Byte1 << _problemDomain << _problemVector
17 << _actionFlags << _reserved4Byte2;
18}
19
20void UserHeader::unflatten(Stream& stream)
21{
22 stream >> _header >> _eventSubsystem >> _eventScope >> _eventSeverity >>
23 _eventType >> _reserved4Byte1 >> _problemDomain >> _problemVector >>
24 _actionFlags >> _reserved4Byte2;
25}
26
27void UserHeader::setSubsystem(uint8_t subsystem)
28{
29 _eventSubsystem = subsystem;
30}
31
32void UserHeader::setSeverity(uint8_t severity)
33{
34 _eventSeverity = severity;
35}
36
37void UserHeader::setType(uint8_t type)
38{
39 _eventType = type;
40}
41
42void UserHeader::setAction(uint16_t action)
43{
44 _actionFlags = action;
45}
46
47} // namespace pel
48} // namespace attn