#
f2e94221 |
| 31-Oct-2023 |
Tao Lin <lintao.lc@ieisystem.com> |
UpdateVirtualSensor uses information from signals
UpdateVirtualSensor uses information obtained from signals to avoid extensive dbus queries.
Tested: 1:Execute DBus cmd to see if VirtualSensor can
UpdateVirtualSensor uses information from signals
UpdateVirtualSensor uses information obtained from signals to avoid extensive dbus queries.
Tested: 1:Execute DBus cmd to see if VirtualSensor can correctly obtain the value of DbusSensor busctl tree xyz.openbmc_project.VirtualSensor busctl introspect xyz.openbmc_project.VirtualSensor xxx 2:Waiting for the value change of DbusSensor,Check if the value of the virtual sensor has changed after the dbusSensor changes.
Fixes openbmc/phosphor-virtual-sensor#1
Change-Id: If11f9017b31ce5cf06f910a38c65637c55d74b24 Signed-off-by: Tao Lin <lintao.lc@ieisystem.com>
show more ...
|
#
8e11cccb |
| 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I8c73d8de128b218ee4885a5e133314ad5d9a0ff8
show more ...
|
#
1204b433 |
| 29-Dec-2021 |
George Liu <liuxiwei@inspur.com> |
Fix some warnings by cppcheck
Warning message:
``` dbusSensor.hpp:28:9: performance: Variable 'servName' is assigned in constructor body. Consider performing initialization in initialization list.
Fix some warnings by cppcheck
Warning message:
``` dbusSensor.hpp:28:9: performance: Variable 'servName' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList] servName = getService(bus, path, sensorIntf); ^ virtualSensor.hpp:69:55: performance: Function parameter 'path' should be passed by const reference. [passedByValue] SensorParam(sdbusplus::bus::bus& bus, std::string path, void* ctx): ^ virtualSensor.hpp:271:44: performance: Function parameter 'configFile' should be passed by const reference. [passedByValue] Json parseConfigFile(const std::string configFile); ^ virtualSensor.cpp:334:26: style: Local variable 'objPath' shadows outer argument [shadowArgument] auto objPath = sensorDbusPath + sensorType + "/" + name; ^ virtualSensor.cpp:255:58: note: Shadowed declaration const std::string& objPath) ^ virtualSensor.cpp:334:26: note: Shadow variable auto objPath = sensorDbusPath + sensorType + "/" + name; ^ virtualSensor.cpp:338:33: style: Local variable 'name' shadows outer variable [shadowVariable] std::string name = j["ParamName"]; ^ virtualSensor.cpp:330:29: note: Shadowed declaration std::string name = desc.value("Name", ""); ^ virtualSensor.cpp:338:33: note: Shadow variable std::string name = j["ParamName"]; ^ virtualSensor.cpp:649:56: performance: Function parameter 'configFile' should be passed by const reference. [passedByValue] Json VirtualSensors::parseConfigFile(const std::string configFile) ```
Tested: Verify that there are no such warnings in local CI.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I8afaf35043c97d0ca6bfcbe9d50c847d126f8e2d
show more ...
|
#
b57d7370 |
| 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: remove usage of deprecated alias
The alias `server::match` has been deprecated since 2016. Use the new alias under bus.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0
sdbusplus: remove usage of deprecated alias
The alias `server::match` has been deprecated since 2016. Use the new alias under bus.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I023ac2138ffc54b5bf7717ac7f75320f561cc00d
show more ...
|
#
a55a907e |
| 06-Apr-2021 |
Thu Ba Nguyen <thu@os.amperecomputing.com> |
Add try catch when getting the sensor values
When the driver of the source sensors is binding, the sensor service name is available but the value property can be unavailable in short time. Getting t
Add try catch when getting the sensor values
When the driver of the source sensors is binding, the sensor service name is available but the value property can be unavailable in short time. Getting the sensor value without try catch can cause exception "sd_bus_call: \ org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable". This commit catchs the exception when getting sensor value to cover that case.
Signed-off-by: Thu Ba Nguyen <thu@os.amperecomputing.com> Change-Id: If946f20e38020767d418d6d80caf4e74db7b49ab
show more ...
|
#
f8db7225 |
| 10-Nov-2020 |
Matt Spinler <spinler@us.ibm.com> |
Tolerate missing sensors on startup
Instead of crashing if one of the sensors listed in the symbol table isn't on D-Bus yet, return quiet_NaN for its value instead. A quiet_NaN is what most of the
Tolerate missing sensors on startup
Instead of crashing if one of the sensors listed in the symbol table isn't on D-Bus yet, return quiet_NaN for its value instead. A quiet_NaN is what most of the sensor applications (all of the dbus-sensors ones) return anyway when they are not able to read the device, and this can be considered similar to that - that the device isn't accessible yet.
This eases the dependencies necessary in the service file, as the service file as it stands now doesn't wait for any sensor providing services to start, and even if it did different virtual sensors could require different dependencies.
An alternative would be to have the code not even put the virtual sensor on D-Bus until all of its required sensors are available, but that adds quite a bit of complexity when usually there will just be a small window after a reboot when the services area all starting up that this would occur.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ifc9b010774fa1a703ff660abe57c57220cc907b3
show more ...
|
#
51f898e2 |
| 10-Sep-2020 |
Vijay Khemka <vijaykhemka@fb.com> |
Add signal based update
update sensors whenever there is a update in parameter dbus sensor. This will register a signal for each dbus sensor parameter and will calculate new value is there is a chan
Add signal based update
update sensors whenever there is a update in parameter dbus sensor. This will register a signal for each dbus sensor parameter and will calculate new value is there is a change in any param sensor value.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com> Change-Id: I164bbb32eea6f29a2378119cdf3ac07492758b09 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
7452a867 |
| 11-Aug-2020 |
Vijay Khemka <vijaykhemka@fb.com> |
Add support for dbus parameter
Added support for parameter type dbus sensor and utility functions to read dbus sensor value.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com> Change-Id: I04db0016f31
Add support for dbus parameter
Added support for parameter type dbus sensor and utility functions to read dbus sensor value.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com> Change-Id: I04db0016f312edea095442a693500c3b4e571d6c
show more ...
|