diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/sensor-example.yaml | 33 | ||||
-rw-r--r-- | scripts/writesensor.mako.cpp | 15 |
2 files changed, 42 insertions, 6 deletions
diff --git a/scripts/sensor-example.yaml b/scripts/sensor-example.yaml index 52eb076..98e9ff6 100755 --- a/scripts/sensor-example.yaml +++ b/scripts/sensor-example.yaml @@ -37,16 +37,16 @@ interfaces: xyz.openbmc_project.Inventory.Item: Present: - 6: + 0x06: assert: true deassert: false type: bool xyz.openbmc_project.State.Decorator.OperationalStatus: Functional: - 4: - assert: false - deassert: true - type: bool + 0x04: + assert: false + deassert: true + type: bool 0x63: interfaces: @@ -91,3 +91,26 @@ 0xFF: type: int64_t +0x54: + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core22 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + 0x07: + assert: true + deassert: false + #The update will be skipped based on the value of skipOn + #in this case if offset 0x07 is deasserted + #the update will be skipped. + skipOn: deassert + type: bool diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp index 5cc024e..9cd4e48 100644 --- a/scripts/writesensor.mako.cpp +++ b/scripts/writesensor.mako.cpp @@ -73,8 +73,21 @@ extern const IdInfoMap sensors = { <% continue %>\ % endif <% valueType = values["type"] %>\ +<% +try: + skip = values["skipOn"] + if skip == "assert": + skipVal = "SkipAssertion::ASSERT" + elif skip == "deassert": + skipVal = "SkipAssertion::DEASSERT" + else: + assert "Unknown skip value " + str(skip) +except KeyError, e: + skipVal = "SkipAssertion::NONE" +%>\ + ${skipVal}, % for name,value in values.items(): - % if name == "type": + % if name == "type" or name == "skipOn": <% continue %>\ % endif % if valueType == "string": |