History log of /openbmc/bmcweb/redfish-core/include/utils/sensor_utils.hpp (Results 1 – 4 of 4)
Revision Date Author Comments
# cd5a898f 14-Aug-2024 Janet Adkins <janeta@us.ibm.com>

Sensors: Add SpeedRPM property

Changes here are to add support for Redfish for Thermal Equipment[1].

Add the SpeedRPM property for a Rotational fan sensor. This property is
part of the Redfish Sens

Sensors: Add SpeedRPM property

Changes here are to add support for Redfish for Thermal Equipment[1].

Add the SpeedRPM property for a Rotational fan sensor. This property is
part of the Redfish Sensor schema since version 1_2_0.[2]

This change is so we will always have a property with the RPM. This
allows a client (e.g. webui-vue) to always look for the SpeedRPM
property.

Note: Redfish defines the Reading property for a fan to be a
percentage value. Currently for this type of fan sensor the Reading
value is being set to the RPM value. To preserve backwards
compatibility the SpeedRPM property is added without altering the
Reading value. However this may change in the future to match the
expected Redfish implementation. Clients are advised to use the new
SpeedRPM value to assure continuing correct function.

[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP2064_1.0.0.pdf
[2] http://redfish.dmtf.org/schemas/v1/Sensor.v1_10_0.json#/definitions/Sensor

Implementation Note: The objectPropertiesToJson() has existing else
if(sensorType ==) statements. However because the first if()
statement is looking at the chassisSubNode these are never visited for
sensors when using the
/redfish/v1/Chassis/<chassisId>/Sensors/<sensorName> URI.
Those existing sensorType comparisons are used for the
redfish-allow-deprecated-power-thermal Redfish interfaces.

```
$ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan1_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan1_0",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "fantach_fan1_0",
"Name": "fan1 0",
"Reading": 18000.0,
"ReadingType": "Rotational",
"ReadingUnits": "RPM",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```

Tested:
- Redfish Validator passes

Change-Id: Icd39fd70d4a24aafab0d9b66fa09c000b97b3199
Signed-off-by: Janet Adkins <janeta@us.ibm.com>

show more ...


# 0c728b42 29-Aug-2024 Janet Adkins <janeta@us.ibm.com>

Sensors: Add enum for chassis sub nodes

Added ChassisSubNode enum for defining the different chassis subNode
paths to retrieving sensor data.

Modified path building sensor data to use the enum. Oth

Sensors: Add enum for chassis sub nodes

Added ChassisSubNode enum for defining the different chassis subNode
paths to retrieving sensor data.

Modified path building sensor data to use the enum. Other paths were
left still using the string. Specifically the paths using
SensorsAsyncResp as these primarily use the strings for human readable
output.

Added utility functions to convert to/from enum to string value.
Added unit tests for new utility functions.

Tested:
- Verified sensor paths before and after change had no change:
- /redfish/v1/Chassis/chassis/Sensors
- /redfish/v1/Chassis/chassis/Thermal
- /redfish/v1/Chassis/chassis/Power
- Selection of: /redfish/v1/Chassis/chassis/Sensors/<sensor>
- /redfish/v1/Chassis/chassis/Sensors?\$expand=*
- Redfish Validator passes

Change-Id: I02bb5f3c0c49d85dbd1dff911d9f1a8467d6b1db
Signed-off-by: Janet Adkins <janeta@us.ibm.com>

show more ...


# c9563608 28-Aug-2024 Janet Adkins <janeta@us.ibm.com>

Sensors: Move objectPropertiesToJson() to sensor_utils

This commit move objectPropertiesToJson() to the sensor_utils class.
This is in preparation for building sensor excerpts using the same code
wh

Sensors: Move objectPropertiesToJson() to sensor_utils

This commit move objectPropertiesToJson() to the sensor_utils class.
This is in preparation for building sensor excerpts using the same code
which builds a sensor. By moving the function into the sensor utility
class it should help with compile time by not needing to include all of
sensor code by the files implementing the excerpts.

Additional functions and definitions were moved into the sensor_utils
class as well due to dependencies from objectPropertiesToJson().

Tested:
- Confirmed output unchanged for following URI:
- /redfish/v1/Chassis/chassis/Sensors
- Selection of: /redfish/v1/Chassis/chassis/Sensors/<sensorId>
- /redfish/v1/Chassis/chassis/Sensors?\$expand=*
- Redfish Validator passes

Change-Id: I563a560b5b2760e0421c1402d51216101af40be2
Signed-off-by: Janet Adkins <janeta@us.ibm.com>

show more ...


# 1516c21b 14-Aug-2024 Janet Adkins <janeta@us.ibm.com>

Sensors: Create utility class for sensors

Create a separate utility class for sensors. The goal is to make these
functions easily available for use outside of sensors for paths which
need reference

Sensors: Create utility class for sensors

Create a separate utility class for sensors. The goal is to make these
functions easily available for use outside of sensors for paths which
need reference sensors.

Moved splitSensorNameAndType() into new utility class.

Created new utility function getSensorId(). The Id for a sensor is
built from its name and type in a few different locations. These are
modified to call the new function. The function has also been
simplified to use std::format() to build the Id.

Tested:
- Checked before and after results for queries using this function:
(Note: I was not able to confirm the setSensorsOverride() caller as
it is only being used for redfish-allow-deprecated-power-thermal
URI.)
'''
- https://${bmc}/redfish/v1/Chassis/chassis/Sensors
- https://${bmc}/redfish/v1/Chassis/chassis/Sensors/<str>
where <str> was sensors of different types
- https://${bmc}/redfish/v1/Chassis/chassis/Sensors?\$expand=*
- https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans
- https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
'''
- Redfish Validator passed

Change-Id: Ifa200b6e63f8e52d47f70c33d350999f5c527bbd
Signed-off-by: Janet Adkins <janeta@us.ibm.com>

show more ...