diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/writesensor.mako.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/scripts/writesensor.mako.cpp b/scripts/writesensor.mako.cpp index 5b1ffd7..b2da7ca 100644 --- a/scripts/writesensor.mako.cpp +++ b/scripts/writesensor.mako.cpp @@ -10,14 +10,17 @@ interfaceDict = {} serviceInterface = sensor["serviceInterface"] if serviceInterface == "org.freedesktop.DBus.Properties": updateFunc = "set::" + getFunc = "get::" elif serviceInterface == "xyz.openbmc_project.Inventory.Manager": updateFunc = "notify::" + getFunc = "inventory::get::" else: assert "Un-supported interface: " + serviceInterface endif if serviceInterface not in interfaceDict: interfaceDict[serviceInterface] = {} interfaceDict[serviceInterface]["updateFunc"] = updateFunc + interfaceDict[serviceInterface]["getFunc"] = getFunc %>\ % endfor @@ -46,6 +49,16 @@ inline ipmi_ret_t readingAssertion(const SetSensorReadingReq& cmdData, return set::readingAssertion<${type}>(cmdData, sensorInfo); } +namespace get +{ + +inline GetSensorResponse readingAssertion(const Info& sensorInfo) +{ + return ipmi::sensor::get::readingAssertion<${type}>(sensorInfo); +} + +} //namespace get + } // namespace sensor_${key} %elif "readingData" == readingType: @@ -59,6 +72,16 @@ inline ipmi_ret_t readingData(const SetSensorReadingReq& cmdData, return set::readingData<${type}>(cmdData, sensorInfo); } +namespace get +{ + +inline GetSensorResponse readingData(const Info& sensorInfo) +{ + return ipmi::sensor::get::readingData<${type}>(sensorInfo); +} + +} //namespace get + } // namespace sensor_${key} %endif @@ -81,17 +104,21 @@ extern const IdInfoMap sensors = { valueReadingType = sensor["readingType"] updateFunc = interfaceDict[serviceInterface]["updateFunc"] updateFunc += sensor["readingType"] + getFunc = interfaceDict[serviceInterface]["getFunc"] + getFunc += sensor["readingType"] if "readingAssertion" == valueReadingType: updateFunc = "sensor_" + str(key) + "::" + valueReadingType + getFunc = "sensor_" + str(key) + "::get::" + valueReadingType elif "readingData" == valueReadingType: updateFunc = "sensor_" + str(key) + "::" + valueReadingType + getFunc = "sensor_" + str(key) + "::get::" + valueReadingType sensorInterface = serviceInterface if serviceInterface == "org.freedesktop.DBus.Properties": sensorInterface = next(iter(interfaces)) mutability = sensor.get("mutability", "Mutability::Read") %> ${sensorType},"${path}","${sensorInterface}",${readingType},${multiplier}, - ${offset},${exp},${offset * pow(10,exp)},${updateFunc},Mutability(${mutability}),{ + ${offset},${exp},${offset * pow(10,exp)},${updateFunc},${getFunc},Mutability(${mutability}),{ % for interface,properties in interfaces.items(): {"${interface}",{ % for dbus_property,property_value in properties.items(): |