Skip to content

Commit

Permalink
esp32: fix QR code URL in shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
chshu committed Nov 11, 2021
1 parent b67cdaf commit 01dc1c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/shell/commands/OnboardingCodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static CHIP_ERROR GetOnboardingQRCodeUrl(bool printHeader)

if (printHeader)
{
streamer_printf(sout, "QRCodeUrl: ");
streamer_printf(sout, "QRCodeUrl: ");
}
ReturnErrorOnFailure(GetQRCode(QRCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)));

Expand All @@ -72,7 +72,7 @@ static CHIP_ERROR GetOnboardingManualPairingCode(bool printHeader)

if (printHeader)
{
streamer_printf(sout, "ManualPairingCode: ");
streamer_printf(sout, "ManualPairingCode: ");
}
ReturnErrorOnFailure(
GetManualPairingCode(manualPairingCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)));
Expand Down
8 changes: 7 additions & 1 deletion src/lib/shell/streamer_esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ int streamer_esp32_init(streamer_t * streamer)
linenoiseSetMultiLine(1);
linenoiseHistorySetMaxLen(100);

if (linenoiseProbe())
{
// Set if terminal does not recognize escape sequences.
linenoiseSetDumbMode(1);
}

esp_console_cmd_t command = { .command = "chip", .help = "CHIP utilities", .func = chip_command_handler };
ESP_ERROR_CHECK(esp_console_cmd_register(&command));
return 0;
Expand All @@ -84,7 +90,7 @@ ssize_t streamer_esp32_read(streamer_t * streamer, char * buf, size_t len)

ssize_t streamer_esp32_write(streamer_t * streamer, const char * buf, size_t len)
{
return fprintf(stdout, buf, len);
return uart_write_bytes(UART_NUM_0, buf, len);
}

static streamer_t streamer_stdio = {
Expand Down

0 comments on commit 01dc1c3

Please sign in to comment.