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

Print pin code and long discriminator on QR screen #7514

Merged
merged 2 commits into from
Jun 10, 2021
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
12 changes: 12 additions & 0 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ std::string createSetupPayload()
ESP_LOGE(TAG, "Couldn't get discriminator: %s", ErrorStr(err));
return result;
}
ESP_LOGI(TAG, "Setup discriminator: %u (0x%x)", discriminator, discriminator);

uint32_t setupPINCode;
err = ConfigurationMgr().GetSetupPinCode(setupPINCode);
Expand All @@ -453,6 +454,7 @@ std::string createSetupPayload()
ESP_LOGE(TAG, "Couldn't get setupPINCode: %s", ErrorStr(err));
return result;
}
ESP_LOGI(TAG, "Setup PIN code: %u (0x%x)", setupPINCode, setupPINCode);

uint16_t vendorId;
err = ConfigurationMgr().GetVendorId(vendorId);
Expand Down Expand Up @@ -669,6 +671,16 @@ extern "C" void app_main()
[=]() {
ESP_LOGI(TAG, "Opening QR code screen");
ESP_LOGI(TAG, "QR CODE Text: '%s'", qrCodeText.c_str());
uint16_t discriminator;
if (ConfigurationMgr().GetSetupDiscriminator(discriminator) == CHIP_NO_ERROR)
{
ESP_LOGI(TAG, "Setup discriminator: %u (0x%x)", discriminator, discriminator);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @cecille This is helpful. Just a suggestion: Can you add the print statements in the function createSetupPayload where the discriminator and the setup pin code are already populated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure - I'll add them there too. I want them on the QR code screen as well so I don't have to go back in the logs when I'm looking for them.

}
uint32_t setupPINCode;
if (ConfigurationMgr().GetSetupPinCode(setupPINCode) == CHIP_NO_ERROR)
{
ESP_LOGI(TAG, "Setup PIN code: %u (0x%x)", setupPINCode, setupPINCode);
}
ScreenManager::PushScreen(chip::Platform::New<QRCodeScreen>(qrCodeText));
})
->Item("Setup",
Expand Down