summaryrefslogtreecommitdiffstats
path: root/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.cpp
blob: fdc2e21a8767d04af29b26d03b9411fc4a52387b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "XIpmiHsbpImp.h"

XIpmiHsbpImp::XIpmiHsbpImp(const XString& hsbpIdentifier):
        hsbpIdentifier_(hsbpIdentifier)
{

}

void XIpmiHsbpImp::setHsbpTemperature(XNumber hsbpTemperature)
{
    comVals_["hsbpTemperature"] = hsbpTemperature;
}
            
void XIpmiHsbpImp::setHsbpIdentifier(const XString& hsbpIdentifier)
{
    comVals_["hsbpIdentifier"] = hsbpIdentifier;
}

json XIpmiHsbpImp::toJson()
{
    try
    {
        json field = {
            {"hsbpIdentifier", hsbpIdentifier_}
        };

        //optional val
        
        field = mergeCommonValues(field, comVals_);

        return field;
    }
    catch (json::exception& e)
    {
        SPDLOG_ERROR("Fail to build XIpmiHsbp to json object:{}.", e.what());
        return json();
    }
}