Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example/linux-example: add newline in printf format #49

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/linux-example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void onAdc(EmbeddedCli *cli, char *args, void *context);
int main() {
// Single character buffer for reading keystrokes
unsigned char c;

// Structures to save the terminal settings for original settings & raw mode
struct termios original_stdin;
struct termios raw_stdin;
Expand Down Expand Up @@ -95,15 +95,15 @@ int main() {

// restore terminal settings
tcsetattr(STDIN_FILENO, TCSANOW, &original_stdin);

return 0;
}

void onCommand(const std::string &name, char *tokens) {
std::cout << "Received command: " << name << "\n";
std::cout << "Received command: " << name << "\r\n";

for (int i = 0; i < embeddedCliGetTokenCount(tokens); ++i) {
std::cout << "Arg " << i << ": " << embeddedCliGetToken(tokens, i + 1) << "\n";
std::cout << "Arg " << i << ": " << embeddedCliGetToken(tokens, i + 1) << "\r\n";
}
}

Expand Down