History log of /openbmc/bmcweb/redfish-core/lib/led.hpp (Results 1 – 25 of 25)
Revision Date Author Comments
# 6be832e2 10-Sep-2024 Ed Tanous <etanous@nvidia.com>

Remove duplicated block comments

Static analysis flags that these two comments are redundant[1], which
seem to be duplicated a lot in copyright headers. Although there is a
larger discussion that c

Remove duplicated block comments

Static analysis flags that these two comments are redundant[1], which
seem to be duplicated a lot in copyright headers. Although there is a
larger discussion that can likely be had.

[1] https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=edtanous_bmcweb&open=AY9_HYjgKXKyw1ZFwgVP

Tested: Comment change only. Code compiles.

Change-Id: Ia960317761f558a87842347ca0b5f3da63f8e730
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# bd79bce8 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 539d8c6b 19-Jun-2024 Ed Tanous <ed@tanous.net>

Consistently use generated enumerations

This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are

Consistently use generated enumerations

This commit causes all of Redfish to use generated enum values for enum
types. Using generated code prevents problems, and makes it more clear
what types are allowed.

Doing this found two places where we had structs that didn't fulfill the
schema. They have been commented, but will be fixed with a breaking
change at some point in the future.

Tested: WIP

Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# e93abac6 14-Jun-2024 Ginu George <ginugeorge@ami.com>

Pass redfishPropertyName earlier argument

It was pointed out that the setDbusProperty method should have an end
that approximately matches dbus-send and busctl set-property in its
arguments, to aid

Pass redfishPropertyName earlier argument

It was pointed out that the setDbusProperty method should have an end
that approximately matches dbus-send and busctl set-property in its
arguments, to aid with debug. This seems reasonable.

Tested: Redfish service validator passes.

Change-Id: Ic20295d93c71c957e3e76704e1eda9da187861b1
Signed-off-by: Ginu George <ginugeorge@ami.com>
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 87c44966 04-Apr-2024 Asmitha Karunanithi <asmitk01@in.ibm.com>

Move to Redfish setProperty call

This commit changes sdbusplus setProperty calls (in various files) to
setDbusProperty method in Redfish namespace that handles all DBus
errors in a consistent manner

Move to Redfish setProperty call

This commit changes sdbusplus setProperty calls (in various files) to
setDbusProperty method in Redfish namespace that handles all DBus
errors in a consistent manner.

It also handles and translates additional DBus errors to Redfish
specific errors in dbus_utils file.

Tested By:
Not tested yet

Change-Id: If440774879413754f4c24f9b6572c3c9fa1fd033
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>

show more ...


# 8ece0e45 02-Jan-2024 Ed Tanous <ed@tanous.net>

Fix spelling mistakes

These were found with:
codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$")

At some point in the future, we might want to get this enabled in CI.

Change-Id: Iccb57b2adfd06a2

Fix spelling mistakes

These were found with:
codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$")

At some point in the future, we might want to get this enabled in CI.

Change-Id: Iccb57b2adfd06a2e177e99db2923fe4e8e329118
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 59a17e4f 07-Oct-2022 George Liu <liuxiwei@inspur.com>

Rename getLocationIndicatorActive/setLocationIndicatorActive

This commit renames
getLocationIndicatorActive/setLocationIndicatorActive
No functional changes.

Tested: built bmcweb successfully and V

Rename getLocationIndicatorActive/setLocationIndicatorActive

This commit renames
getLocationIndicatorActive/setLocationIndicatorActive
No functional changes.

Tested: built bmcweb successfully and Validator passes

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I0c5d538c1dd9f0d8dd1e6ae4d8ba4f606b804373
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>

show more ...


# 5a39f77a 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I2f9540cf0d545a2da4d6289fc87b754f684bc9a7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 62598e31 17-Jul-2023 Ed Tanous <ed@tanous.net>

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.

Tested: compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8

show more ...


# 9ae226fa 21-Jun-2023 George Liu <liuxiwei@inspur.com>

Refactor setProperty method

SetProperty is a method we should use more, and use consistently in the
codebase, this commit makes it consistently used from the utility
namespace.

Tested: Refactor. C

Refactor setProperty method

SetProperty is a method we should use more, and use consistently in the
codebase, this commit makes it consistently used from the utility
namespace.

Tested: Refactor. Code compiles.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I5939317d23483e16bd98a8298f53e75604ef374d

show more ...


# ac106bf6 07-Jun-2023 Ed Tanous <edtanous@google.com>

Consistently name AsyncResp variables

In about half of our code, AsyncResp objects take the name asyncResp,
and in the other half they take the name aResp. While the difference
between them is negl

Consistently name AsyncResp variables

In about half of our code, AsyncResp objects take the name asyncResp,
and in the other half they take the name aResp. While the difference
between them is negligeble and arbitrary, having two naming conventions
makes it more difficult to do automated changes over time via grep.

This commit was generated automtatically with the command:
git grep -l 'aResp' | xargs sed -i 's|aResp|asyncResp|g'

Tested: Code compiles.

Change-Id: Id363437b6a78f51e91cbf60aa0a0c2286f36a037
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# 5e7e2dc5 16-Feb-2023 Ed Tanous <edtanous@google.com>

Take boost error_code by reference

By convention, we should be following boost here, and passing error_code
by reference, not by value. This makes our code consistent, and removes
the need for a co

Take boost error_code by reference

By convention, we should be following boost here, and passing error_code
by reference, not by value. This makes our code consistent, and removes
the need for a copy in some cases.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae

show more ...


# 3ccb3adb 13-Jan-2023 Ed Tanous <edtanous@google.com>

Fix a boatload of #includes

Most of these missing includes were found by running clang-tidy on all
files, including headers. The existing scripts just run clang-tidy on
source files, which doesn't

Fix a boatload of #includes

Most of these missing includes were found by running clang-tidy on all
files, including headers. The existing scripts just run clang-tidy on
source files, which doesn't catch most of these.

Tested: Code compiles

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic741fbb2cc9e5e92955fd5a1b778a482830e80e8

show more ...


# 002d39b4 31-May-2022 Ed Tanous <edtanous@google.com>

Try to fix the lambda formatting issue

clang-tidy has a setting, LambdaBodyIndentation, which it says:
"For callback-heavy code, it may improve readability to have the
signature indented two levels

Try to fix the lambda formatting issue

clang-tidy has a setting, LambdaBodyIndentation, which it says:
"For callback-heavy code, it may improve readability to have the
signature indented two levels and to use OuterScope."

bmcweb is very callback heavy code. Try to enable it and see if that
improves things. There are many cases where the length of a lambda call
will change, and reindent the entire lambda function. This is really
bad for code reviews, as it's difficult to see the lines changed. This
commit should resolve it. This does have the downside of reindenting a
lot of functions, which is unfortunate, but probably worth it in the
long run.

All changes except for the .clang-format file were made by the robot.

Tested: Code compiles, whitespace changes only.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43

show more ...


# 1e1e598d 11-Jun-2021 Jonathan Doman <jonathan.doman@intel.com>

Using sdbusplus::asio::getProperty

It simplifies a lot of code and after changing sdbusplus implementation
slightly reduces binary size if used together with:

https://gerrit.openbmc-project.xyz/c/o

Using sdbusplus::asio::getProperty

It simplifies a lot of code and after changing sdbusplus implementation
slightly reduces binary size if used together with:

https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/49467

* Uncompressed size: 3033148 -> 3012164, -20984 B
* gzip compressed size: 1220586 -> 1214625, -5961 B

Tested:
- Redfish validator output is the same before and after the change

Change-Id: Ibe3227d3f4230de2363ba3d9396e51130c8240a5
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>

show more ...


# 168e20c1 13-Dec-2021 Ed Tanous <edtanous@google.com>

Move to common variant

This saves approximately 34kB in the compressed binary size of bmcweb
due to reduced template instantiations. This amounts to a 2.5%
reduction in the overall

Move to common variant

This saves approximately 34kB in the compressed binary size of bmcweb
due to reduced template instantiations. This amounts to a 2.5%
reduction in the overall size.

Note, there were a few places where we broke const-correctness in the
form of pulling a non-const reference out of a const variant. This
new variant now requires const correctness, so some consts are
added where required.

Tested: Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2

show more ...


# 7e860f15 08-Apr-2021 John Edward Broadbent <jebr@google.com>

Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDyna

Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDynamic(). However
now app.routeDynamic can handle the complexity that was once in critical
to node. The macro app.routeDynamic() provides a shorter cleaner
interface to the unerlying app.routeDyanic call. The old pattern set
permissions for 6 interfaces (get, head, patch, put, delete_, and post)
even if only one interface is created. That pattern creates unneeded
code that can be safely removed with no effect.
Unit test for the responses would have to mock the node the class in
order to fully test responses.

see https://github.com/openbmc/bmcweb/issues/181

The following files still need node to be extracted.

virtual_media.hpp
account_service.hpp
redfish_sessions.hpp
ethernet.hpp

The files above use a pattern that is not trivial to address. Often their
responses call an async lambda capturing the inherited class. ie
(https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770
28d258fa/redfish-core/lib/account_service.hpp#L1393)
At a later point I plan to remove node from the files above.

Tested:
I ran the docker unit test with the following command.
WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb
./openbmc-build-scripts/run-unit-test-docker.sh

I ran the validator and this change did not create any issues.
python3 RedfishServiceValidator.py -c config.ini

Signed-off-by: John Edward Broadbent <jebr@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df

show more ...


# 8d1b46d7 31-Mar-2021 zhanghch05 <zhanghch05@inspur.com>

Using AsyncResp everywhere

Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response

Using AsyncResp everywhere

Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended after the first tree is done populating.
Don't use res.end() anymore.

Tested:
1. Validator passed.

Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8

show more ...


# 1d40ef69 26-Feb-2021 Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>

led: Fix for Chassis IndicatorLED patch response

While Patching Chassis Indicator LED from Redfish, response is showing
as empty but HTTPS status code is "200 OK" on successful case.

led: Fix for Chassis IndicatorLED patch response

While Patching Chassis Indicator LED from Redfish, response is showing
as empty but HTTPS status code is "200 OK" on successful case.
So provided fix for Proper response on Success.

Tested:
1. Verified RedFish validator passed
2. Verified the response on Redfish by updating IndicatorLED status.
PATCH: https://<BMC-IP>/redfish/v1/Chassis/<Baseboard-ID>
Body:
{
"IndicatorLED": "Blinking"
}
Response:
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "Successfully Completed Request",
"MessageArgs": [],
"MessageId": "Base.1.8.1.Success",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}

Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I2e1281e6c06c445fe8d0c350bb74ea18f3461a35

show more ...


# 9f8bfa7c 28-Sep-2020 Gunnar Mills <gmills@us.ibm.com>

Add new Location Indicator property

In ComputerSystem 1.13 and Chassis 1.14 as well as in many other
schemas IndicatorLED is replaced with LocationIndicatorActive.

LocationIndic

Add new Location Indicator property

In ComputerSystem 1.13 and Chassis 1.14 as well as in many other
schemas IndicatorLED is replaced with LocationIndicatorActive.

LocationIndicatorActive is a bool while IndicatorLED had 3 states:
Lit, Blink, and off. Map Lit and Blink both to
LocationIndicatorActive true.

led.hpp was calling both enclosure_identify_blink and
enclosure_identify, continue this.

Keep the deprecated IndicatorLED and implement the new
LocationIndicatorActive property. Have both properties for
the time being. This new property makes the same calls.

This does add a new Redfish warning for the deprecated
IndicatorLED. Other warning are there today.

Tested: Validator passes
Could use help testing on Chassis. Our systems don't have a
IndicatorLED on chassis. See chassis bumped.
curl -k https://$bmc/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_13_0.ComputerSystem",
...
"IndicatorLED": "Off",
"LastResetTime": "2020-10-29T09:01:03+00:00",
"Links": {
"Chassis": [
{
"@odata.id": "/redfish/v1/Chassis/chassis"
}
],
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/bmc"
}
]
},
"LocationIndicatorActive": false,

curl -X PATCH -d '{ "LocationIndicatorActive":true}' -k \
https://$bmc/redfish/v1/Systems/system

curl -X PATCH -d '{ "IndicatorLED":"Off"}' -k \
https://$bmc/redfish/v1/Systems/system

Change-Id: I105bed5794912c575aa9a00e0442461bfdee6180
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# b5a76932 29-Sep-2020 Ed Tanous <ed@tanous.net>

Lots of performance improvements

(In the voice of the kid from sixth sense) I see string copies...

Apparently there are a lot of places we make unnecessary copies. This
fixes al

Lots of performance improvements

(In the voice of the kid from sixth sense) I see string copies...

Apparently there are a lot of places we make unnecessary copies. This
fixes all of them.

Not sure how to split this up into smaller patches, or if it even needs
split up. It seems pretty easy to review to me, because basically every
diff is identical.

Change-Id: I22b4ae4f96f7e4082d2bc701098a04f7bed95369
Signed-off-by: Ed Tanous <ed@tanous.net>
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>

show more ...


# cb13a392 25-Jul-2020 Ed Tanous <ed@tanous.net>

Enable unused variable warnings and resolve

This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional

Enable unused variable warnings and resolve

This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I think it was worthwhile. It also cleaned up several unused
variable from old constructs that no longer exist.

Tested:
Built with clang. Code no longer emits warnings.

Downloaded bmcweb to system and pulled up the webui, observed webui
loads and logs in properly.

Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 23a21a1c 24-Jul-2020 Ed Tanous <ed@tanous.net>

Enable clang warnings

This commit enables clang warnings, and fixes all warnings that were
found. Most of these fall into a couple categories:

Variable shadow issues were fixed

Enable clang warnings

This commit enables clang warnings, and fixes all warnings that were
found. Most of these fall into a couple categories:

Variable shadow issues were fixed by renaming variables

unused parameter warnings were resolved by either checking error codes
that had been ignored, or removing the name of the variable from the
scope.

Other various warnings were fixed in the best way I was able to come up
with.

Note, the redfish Node class is especially insidious, as it causes all
imlementers to have variables for parameters, regardless of whether or
not they are used. Deprecating the Node class is on my list of things
to do, as it adds extra overhead, and in general isn't a useful
abstraction. For now, I have simply fixed all the handlers.

Tested:
Added the current meta-clang meta layer into bblayers.conf, and added
TOOLCHAIN_pn-bmcweb = "clang" to my local.conf

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia75b94010359170159c703e535d1c1af182fe700

show more ...


# 1214b7e7 04-Jun-2020 Gunnar Mills <gmills@us.ibm.com>

clang-format: update to latest from docs repo

This is from openbmc/docs/style/cpp/.clang-format

Other OpenBMC repos are doing the same.

Tested: Built and validator passed.

clang-format: update to latest from docs repo

This is from openbmc/docs/style/cpp/.clang-format

Other OpenBMC repos are doing the same.

Tested: Built and validator passed.
Change-Id: Ief26c755c9ce012823e16a506342b0547a53517a
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 1c8fba97 20-Dec-2019 James Feist <james.feist@linux.intel.com>

Add IndicatorLed to Chassis Schema

This adds the indicator property to Chassis Schema,
and moves the logic from systems.hpp to a common header
to share the code.

Tested: Pas

Add IndicatorLed to Chassis Schema

This adds the indicator property to Chassis Schema,
and moves the logic from systems.hpp to a common header
to share the code.

Tested: Passed the validator, was able to turn LED on

Change-Id: I79458a2a4656d7ddf2939bb9f56845eb6d9a27ca
Signed-off-by: James Feist <james.feist@linux.intel.com>

show more ...