After I enable the read sensor interface in the code below, the value of the discrete sensor can be read. I think there should be a place in the ipmid code. After a certain condition is detected, the sensor will be enabled. Can someone please help guide the
operation of the enable sensor? Where is the code?
ipmiSensorGetSensorReading(uint8_t sensorNum)
{
if (sensorNum == 0xFF)
{
return ipmi::responseInvalidFieldRequest();
}
const auto iter = ipmi::sensor::sensors.find(sensorNum);
if (iter == ipmi::sensor::sensors.end())
{
return ipmi::responseSensorInvalid();
}
if (ipmi::sensor::Mutability::Read !=
(iter->second.mutability & ipmi::sensor::Mutability::Read))
{
return ipmi::responseIllegalCommand();
}
try
{
ipmi::sensor::GetSensorResponse getResponse =
iter->second.getFunc(iter->second);
enableScanning(&response);
return ipmi::responseSuccess(getResponse.reading, uint5_t(0),
getResponse.readingOrStateUnavailable,
getResponse.scanningEnabled,
getResponse.allEventMessagesEnabled,
getResponse.thresholdLevelsStates,
getResponse.discreteReadingSensorStates);
}
Hi,
I added some discrete sensors to openbmc, but I used the ipmitool command to query and found that all discrete sensors displayed na. Please help and guide, thank you. Examples are as follows.
F:\ipmitool v1.8.18>ipmitool.exe -I lanplus -C 17 -H 172.16.90.172 -U root -P 0penBmc sensor list
PowerDrop | na | discrete | na | na | na | na | na | na | na
F:\ipmitool v1.8.18>ipmitool.exe -I lanplus -C 17 -H 172.16.90.172 -U root -P 0penBmc sensor get
PowerDrop
Locating sensor record...
Sensor ID :
PowerDrop (0x28)
Entity ID : 7.1
Sensor Type (Discrete): Power Supply
Unable to read sensor: Device Not Present
I have checked the dbus interface corresponding to PowerDrop, and it can be set and inquired through the busctl command;
Thankyou!
harley.