Skip to content

Cli navigation#33

Open
EddyTheCo wants to merge 5 commits into
amarula:mainfrom
EddyTheCo:cli_navigation
Open

Cli navigation#33
EddyTheCo wants to merge 5 commits into
amarula:mainfrom
EddyTheCo:cli_navigation

Conversation

@EddyTheCo
Copy link
Copy Markdown
Contributor

Use readline to add completion, line editing, and interactive history manipulation to the connmanctl_dbus example app.
Fix some small issues in the example and in the property value mapping of the services.
Remove the use of the standard output streams when getting properties. The consumer should define the output stream to put the properties.

EddyTheCo added 3 commits May 12, 2026 13:06
Connman could set the IPv6·privacy·option as prefered and also
preferred.
Add the misspelled property value to the map for the same key.

Signed-off-by: Eduardo Gonzalez <eduardo.gonzalez@amarulasolutions.com>
Remove the print method of the different properties.
The consumer should define the output stream to put the properties.
Remove unused iostream header includes.

Signed-off-by: Eduardo Gonzalez <eduardo.gonzalez@amarulasolutions.com>
Signed-off-by: Eduardo Gonzalez <eduardo.gonzalez@amarulasolutions.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates the readline library into the connmanctl example to provide an interactive CLI with command completion and improved asynchronous message handling. It also refactors the property printing logic across the library by replacing print() methods with operator<< overloads for better stream integration. Feedback highlights several critical thread-safety issues and state management bugs in the new CLI implementation, specifically regarding data races on shared variables like connecting and passphrase, and potential hangs if connection attempts fail. Additionally, the use of the non-thread-safe std::localtime was flagged for replacement with localtime_r to ensure library reliability in multi-threaded environments.

Comment thread examples/connmanctl.cpp
Comment thread examples/connmanctl.cpp
Comment thread examples/connmanctl.cpp
Comment thread examples/connmanctl.cpp Outdated
Comment thread examples/connmanctl.cpp Outdated
Comment thread src/dbus/gconnman_clock.cpp
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the connmanctl example by integrating GNU Readline to provide an interactive shell with tab completion and command history. It also refactors the library's property printing mechanism by replacing print() member functions with operator<< overloads across various property classes and updates the test suite accordingly. Feedback from the review identifies a thread-safety issue with std::localtime in the clock properties implementation, a potential data race on the connecting flag in the example application, and missing header inclusions for string manipulation functions.

Comment thread src/dbus/gconnman_clock.cpp
Comment thread examples/connmanctl.cpp Outdated
Comment thread examples/connmanctl.cpp
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

Comment thread examples/connmanctl.cpp Outdated
@github-actions
Copy link
Copy Markdown

🧩 Build Artifacts

✅ The following build artifacts were produced:

EddyTheCo added 2 commits May 12, 2026 16:07
Add readline in the connmanctl_dbus example.
Allows completion, line editing, and interactive history while using the
app.
Improve command string manipulation and align better on how original
connmanctl works.

Signed-off-by: Eduardo Gonzalez <eduardo.gonzalez@amarulasolutions.com>
Signed-off-by: Eduardo Gonzalez <eduardo.gonzalez@amarulasolutions.com>
@github-actions
Copy link
Copy Markdown

🧩 Build Artifacts

✅ The following build artifacts were produced:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant