Hi Corey,
Thanks for the patch. It is working well now. Now we are able to get the
current value of the sensor in the input parameters of the event handler
function.
Is this a official patch? When will it be included in the main source?
thanks and regards
S Sarath
On Wednesday, June 4, 2014 9:37 PM, Corey Minyard <[email protected]> wrote:
On 06/04/2014 09:50 AM, sarath azad wrote:
> Hi Corey,
>
> For threshold sensor's event handler for example as below, we are
> getting value as 0 only all the times. Only the raw_value is coming
> properly.
> int sensorThresholdEventHandler(ipmi_sensor_t *sensor,
> enum
> ipmi_event_dir_e direction,
> enum
> ipmi_thresh_e threshold,
> enum
> ipmi_event_value_dir_e high_low,
> enum
> ipmi_value_present_e value_present,
> unsigned
> int raw_value,
>
> double value,
>
> void *cb_data,
>
> ipmi_event_t *event)
>
> We are testing the events by using ipmitool to change the threshold
> value of the sensor so that its current value is outside the
> threshold. This way we are getting the event generated and handler
> function being called. But we are not getting the current value.
> Always it is coming as 0 only.
> For temperature sensors it was ok, as both raw_value is same as actual
> value. But for voltage sensors, we are not able to extract value from
> the raw_value obtained in the event handler.
>
> Could you please help in resolving the problem?
Hmm, I think I see a bug. Can you try the attached patch?
If that doesn't work, can you print out the raw values of the bytes in
event and the value_present value and send them to me? I should be able
to tell from that. To get the data, call data =
ipmi_event_get_data_ptr(info->event); and dump 13 bytes from data.
If you look in table 32-1 in the spec, it has the layout of an event.
The event data is what we are really interested in. Table 29-6 in the
spec give the format of the event data. We are particularly interested
in event data 1. If bytes [5:4] in event data 1 is not 01b, then that
is saying that there is no value in the event. If that is the case, the
library should set value_present to IPMI_NO_VALUES_PRESENT, depending on
whether it could convert the event. I had a "2" instead of a "1" there.
-corey
>
> thanks and regards
> S Sarath
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer