Discrete sensor able to send an event

Hello,

I have created a discrete sensor (i.e. SENSOR_GPIO). But I can’t enable event sending. I found the CFG_SENSOR_EVENT_ENABLE define in one of the sensor source files, so I defined it in the user_defs.h header file, but I still can’t get an event when the gpio sensor state changes?

Cheers,

Fatih

Hello Fatih,

this works, you just have to specify the assertion/de-assertion event masks in the XML for the GPIO sensor in question. Below is an example XML snippet:

<Sensor>
  <Name>PIM_ALARM</Name>
  <Type>Processor</Type>
  <Params>
    <p type="record_id"></p>
    <p type="user">0x2</p>
    <p type="user">PIM_ALARM</p>
  </Params>
  <DiscreteRdMask>0x0003</DiscreteRdMask>
  <AssertEvMask>0x0002</AssertEvMask>
  <DeassertEvMask>0x0002</DeassertEvMask>
</Sensor>

The related event mask settings are listen in the sensor guide on pages 8/9 here:

https://cernbox.cern.ch/pdf-viewer/eos/project/c/cern-ipmc-support/public/CERN-IPMC%20-%20Sensor.pdf

However this basically just relates information from the IPMI standard, which also unfortunately does not explain this very well. I have however updated the GPIO sensor example in the ipmc-project repository accordingly:

https://gitlab.cern.ch/ep-ese-be-xtca/ipmc-project/-/blob/master/config.xml?ref_type=heads#L231

Please let me know if this does not work for you.

cheers,

Stefan