回复: all discrete sensor shows na

周 远清 zhouyuanqing8 at outlook.com
Tue Nov 3 01:25:41 AEDT 2020


Hi,

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);
    }

harley
________________________________
发件人: openbmc <openbmc-bounces+zhouyuanqing8=outlook.com at lists.ozlabs.org> 代表 周 远清 <zhouyuanqing8 at outlook.com>
发送时间: 2020年10月31日 10:31
收件人: openbmc <openbmc at lists.ozlabs.org>
抄送: uperic at 163.com <uperic at 163.com>
主题: all discrete sensor shows na

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20201102/c1779c43/attachment.htm>


More information about the openbmc mailing list