Menu

#1287 Hysteresis values are not validated correctly

2.13.3
closed-fixed
5
2009-02-13
2007-09-28
Anton Pak
No

File: utils/sahpi_struct_utils.c
Macro: "validate_threshold"

When trying set negative hysteresis OpenHPI returns
SA_HPI_ERR_INVALID_CMD,

but spec says it should return SA_HPI_ERR_INVALID_DATA.

section 7.2.7 (B.02.01 and B.01.01)

Discussion

  • Anton Pak

    Anton Pak - 2007-09-28
     
  • Renier Morales

    Renier Morales - 2007-10-01
    • milestone: --> 752710
    • assigned_to: nobody --> renierm
     
  • Renier Morales

    Renier Morales - 2007-10-01

    Logged In: YES
    user_id=660960
    Originator: NO

    Can you provide a test case for this?
    For example, provide the SensorThresholds and RDR being used.
    Because there is a similar test in the HPI Compliance Test Suite that passes running on OpenHPI.

     
  • Anton Pak

    Anton Pak - 2007-10-18

    Logged In: YES
    user_id=1858377
    Originator: YES

    Renier, sorry. It is not negative hysteresis issue.
    I've found it analyzing Sensor/saHpiSensorThresholdsSet/NegativeHysteresis test failure.

    The issue is: the hysteresis value is relative and its comparison with SAHPI_SRF_MIN and SAHPI_SRF_MAX is not correct.

    The "validate_threshold" macro tests if hyst value > 0 and then tests hyst value > SAHPI_SRF_MIN and returns SA_HPI_ERR_INVALID_CMD.

     
  • Renier Morales

    Renier Morales - 2007-11-03

    Logged In: YES
    user_id=660960
    Originator: NO

    What you are stating is not clear in the spec. The specification does not say that SRF_MIN/MAX values don't apply to hysteresis values. Could you post this question on the SAF hardware platform mailing list (http://saforum.org)?

     
  • Renier Morales

    Renier Morales - 2007-11-03
    • milestone: 752710 --> 761457
     
  • Renier Morales

    Renier Morales - 2008-02-29

    Logged In: YES
    user_id=660960
    Originator: NO

    Any updates on this?

     
  • Renier Morales

    Renier Morales - 2008-02-29
    • milestone: 761457 --> 761458
     
  • Renier Morales

    Renier Morales - 2008-04-08
    • milestone: 761458 --> 761459
     
  • Renier Morales

    Renier Morales - 2008-05-27
    • milestone: 761459 -->
    • status: open --> closed-out-of-date
     
  • Anton Pak

    Anton Pak - 2009-02-11

    I have an update:

    ----------------------------------------------------
    On Wed, 11 Feb 2009 18:22:06 +0300, <Thomas.Kasimir@> wrote:

    > Anton, David,
    >
    > I fully agree as well.
    >
    >
    > Regards,
    >
    > Thomas
    >
    > -----Original Message-----
    > From: David McKinley [mailto:dmckinley@]
    > Sent: Wednesday, February 11, 2009 4:09 PM
    > To: Anton Pak; twg-hardwareplatform@saforum.org
    > Subject: RE: [twg-hardwareplatform] Question about min/max value for
    > sensor hysteresis
    >
    > Anton,
    >
    > I would absolutely agree. It doesn't make sense to compare hysteresis
    > values, which represent deltas, with the sensor max/min ranges, which
    > are absolute values.
    >
    > David
    >
    >> -----Original Message-----
    >> From: Anton Pak [mailto:anton.pak@]
    >> Sent: Wednesday, February 11, 2009 5:37 AM
    >> To: twg-hardwareplatform@saforum.org
    >> Subject: [twg-hardwareplatform] Question about min/max value
    >> for sensor hysteresis
    >>
    >> Hello!
    >>
    >> One more question about sensor hysteresis.
    >>
    >> Some time ago there was a discussion in openhpi-devel mailing
    >> list about how to check valid values for sensor hysteresis.
    >>
    >> Rdr.SensorRec.DataFormat.Range may define Min and Max values.
    >> Sensor thresholds cannot be set outside of the range defined
    >> by [min, max]
    >> if these limits are present.
    >>
    >> But what about hysteresis values?
    >> Current implementation uses the same criterion for them :
    >> hysteresis must in [min, max] range.
    >>
    >> But it looks strange from my point of view.
    >> The agrument:
    >> Hysteresis value is not absolute value, but relative value.
    >> One shall compare sensor reading with (threshold +
    >> positive_hysteresis) or (threshold - negative_hysteresis).
    >> Even for sensor with reading in range [100, 200] zero value
    >> for hysteresis looks reasonable.
    >>
    >> What say?
    >>
    >> Anton Pak
    >>

     
  • Anton Pak

    Anton Pak - 2009-02-11
    • assigned_to: renierm --> avpak
    • milestone: --> 2.13.3
    • status: closed-out-of-date --> open
     
  • Anton Pak

    Anton Pak - 2009-02-13
    • status: open --> closed-fixed
     
  • Anton Pak

    Anton Pak - 2009-02-13

    fixed in trunk (revision #6954)