| commit | e6bd846d38bf7bb565b3f6a9aa8236543feb59f4 | [log] [tgz] |
|---|---|---|
| author | Nan Zhou <nanzhoumails@gmail.com> | Wed Jun 01 04:35:35 2022 +0000 |
| committer | Nan Zhou <nanzhoumails@gmail.com> | Wed Jun 01 19:03:09 2022 +0000 |
| tree | c0155e7c09b36eb145906bdd0716c58a9544f66c | |
| parent | f65fca6a44ded566fa6e993b1b23b2e189a48703 [diff] |
sensors: use inline functions + bind_front
This commit changes the `/redfish/v1/Chassis/<str>/Sensors/<str>/` route
to take std::bind_front instead of lambdas. We can clearly see the
indent levels decrease. It increases the readability.
Tested:
1. trivial change; code compiles.
2. tested on my local mock environment;
URL: /redfish/v1/Chassis/fake_chassis/Sensors/sensor0
Response:
{
"@odata.id": "/redfish/v1/Chassis/fake_chassis/Sensors/sensor0",
"@odata.type": "#Sensor.v1_0_0.Sensor",
"Id": "sensor0",
"Name": "sensor0",
"Reading": 0.0,
"ReadingRangeMax": null,
"ReadingRangeMin": null,
"ReadingType": "Current",
"ReadingUnits": "A",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
3. Service Validator Pass
*** /redfish/v1/Chassis/fake_chassis/Sensors/sensor0
Type (Sensor.v1_0_0.Sensor), GET SUCCESS (time: 0:00:00.007105)
PASS
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ic60521a937a8b18d317390fc75d792c58f56e3e6
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D flags that correspond to options in bmcweb/meson_options.txt and then compiling. For example, meson <builddir> -Dkvm=disabled ... followed by ninja in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1 algorithm. The certificate
C=US, O=OpenBMC, CN=testhost,SHA-256 algorithm.