From 3c58bce0533a1a3c0403a2ec9081d0b375a69e08 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven Date: Wed, 6 Jul 2022 17:28:48 +0000 Subject: [PATCH] Pull request #9: Update QRCode method Merge in WMN_TOOLS/matter from fix_ci to silabs Squashed commit of the following: commit 784b59e8e9a20c4fb89266d8a06391a0bbb5640f Author: jepenven-silabs Date: Tue Jul 5 14:33:59 2022 -0400 Update QRCode method --- silabs_examples/template/efr32/src/AppTask.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/silabs_examples/template/efr32/src/AppTask.cpp b/silabs_examples/template/efr32/src/AppTask.cpp index cc8dd6d6c7d6cd..74f2c429e6ddb1 100644 --- a/silabs_examples/template/efr32/src/AppTask.cpp +++ b/silabs_examples/template/efr32/src/AppTask.cpp @@ -275,11 +275,13 @@ CHIP_ERROR AppTask::Init() // Print setup info on LCD if available #ifdef DISPLAY_ENABLED - std::string QRCode; + // Create buffer for QR code that can fit max size and null terminator. + char qrCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; + chip::MutableCharSpan QRCode(qrCodeBuffer); if (GetQRCode(QRCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)) == CHIP_NO_ERROR) { - LCDWriteQRCode((uint8_t *) QRCode.c_str()); + LCDWriteQRCode((uint8_t *) QRCode.data()); } else {