commit | bd992c9f62dbf127a21de26714662f92eabd0156 | [log] [tgz] |
---|---|---|
author | Ninad Palsule <ninadpalsule@us.ibm.com> | Tue May 09 18:30:01 2023 -0500 |
committer | Andrew Jeffery <andrew@aj.id.au> | Wed May 17 07:28:54 2023 +0000 |
tree | ca4203b34e4b7d089d70bfc298a3f11285575290 | |
parent | 5ba20b5bf1351a3550b56c2a6eca7045336d8001 [diff] |
Add Connect() method to console DBUS object Added new poller and consumer for the console DBUS data. Note: We initially developed SocketName attribute but it is now deprecated/removed. The tree of default object: $ busctl tree xyz.openbmc_project.Console.default `-/xyz `-/xyz/openbmc_project `-/xyz/openbmc_project/console `-/xyz/openbmc_project/console/default The introspect of default console: $ busctl introspect xyz.openbmc_project.Console.default /xyz/openbmc_project/console/default NAME TYPE SIGNATURE RESULT/VALUE FLAGS org.freedesktop.DBus.Introspectable interface - - - .Introspect method - s - org.freedesktop.DBus.Peer interface - - - .GetMachineId method - s - .Ping method - - - org.freedesktop.DBus.Properties interface - - - .Get method ss v - .GetAll method s a{sv} - .Set method ssv - - .PropertiesChanged signal sa{sv}as - - xyz.openbmc_project.Console.Access interface - - - .Connect method - h - xyz.openbmc_project.console interface - - - .setBaudRate method u x - .baudrate property u 0 - Tested: Performed integration testing with bmcweb. Change-Id: I2444b1083cf26536f43c6f6b4b0857a2921c4f78 Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
To build this project, run the following shell commands:
meson setup build meson compile -C build
To test:
meson test -C build
Running the server requires a serial port (e.g. /dev/ttyS0):
touch obmc-console.conf ./obmc-console-server --config obmc-console.conf ttyS0
To connect to the server, simply run the client:
./obmc-console-client
To disconnect the client, use the standard ~.
combination.
This shows how the host UART connection is abstracted within the BMC as a Unix domain socket.
+---------------------------------------------------------------------------------------------+ | | | obmc-console-client unix domain socket obmc-console-server | | | | +----------------------+ +------------------------+ | | | client.2200.conf | +---------------------+ | server.ttyVUART0.conf | | +---+--+ +----------------------+ | | +------------------------+ +--------+-------+ Network | 2200 +--> +->+ @obmc-console.host0 +<-+ <--+ /dev/ttyVUART0 | UARTs +---+--+ | console-id = "host0" | | | | console-id = "host0" | +--------+-------+ | | | +---------------------+ | | | | +----------------------+ +------------------------+ | | | | | | | +---------------------------------------------------------------------------------------------+
This supports multiple independent consoles. The console-id
is a unique portion for the unix domain socket created by the obmc-console-server instance. The server needs to know this because it needs to know what to name the pipe; the client needs to know it as it needs to form the abstract socket name to which to connect.