xref: /openbmc/phosphor-fan-presence/docs/monitor/class.md (revision 6d3e18c0ba31a99f31ff053809918c2c4fa304b2)
157caa923SMatthew Barth# class
257caa923SMatthew Barth
357caa923SMatthew Barth## Description
4a49e3f19SPatrick Williams
502e78360SMatthew BarthA trust group determination class that implements a way to check a group of fan
602e78360SMatthew Barthsensors trust state. Each of these 'classes' override a required function that
702e78360SMatthew Barthdetermines if the group is trusted by checking each fan sensors listed within
8a49e3f19SPatrick Williamsthe trust group against an algorithm that returns whether they can be trusted or
9a49e3f19SPatrick Williamsnot.
1057caa923SMatthew Barth
1157caa923SMatthew Barth## Attribute Value(s)
12a49e3f19SPatrick Williams
13a49e3f19SPatrick Williams- `NonzeroSpeed`
14a49e3f19SPatrick Williams  - Determines if the group is trusted by checking if any sensors in the group
15a49e3f19SPatrick Williams    has a nonzero speed. If all sensors report zero, then no sensors in the
16a49e3f19SPatrick Williams    group are trusted and therefore monitoring of all the sensors in the group
17a49e3f19SPatrick Williams    is canceled.
1857caa923SMatthew Barth
1957caa923SMatthew Barth## Example
20a49e3f19SPatrick Williams
21*6d3e18c0SGeorge Liu```json
2202e78360SMatthew Barth{
2302e78360SMatthew Barth  "sensor_trust_groups": [
2402e78360SMatthew Barth    {
25*6d3e18c0SGeorge Liu      "class": "NonzeroSpeed",
2602e78360SMatthew Barth      "group": [
2702e78360SMatthew Barth        {
2802e78360SMatthew Barth          "name": "fan0_0"
2902e78360SMatthew Barth        },
3002e78360SMatthew Barth        {
3102e78360SMatthew Barth          "name": "fan1_0"
3202e78360SMatthew Barth        },
3302e78360SMatthew Barth        {
3402e78360SMatthew Barth          "name": "fan2_0",
3502e78360SMatthew Barth          "in_trust": false
3602e78360SMatthew Barth        }
3702e78360SMatthew Barth      ]
3802e78360SMatthew Barth    }
3902e78360SMatthew Barth  ]
4002e78360SMatthew Barth}
41*6d3e18c0SGeorge Liu```
42