Skip to content

Commit

Permalink
example/linux-example: add newline in printf format (#49)
Browse files Browse the repository at this point in the history
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
  • Loading branch information
Junbo-Zheng committed May 7, 2024
1 parent 16801ec commit 8734a57
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 8734a57

Please sign in to comment.