Skip to content

Commit 50daa97

Browse files
[shell] Fixed NFC shell command to not ignore error code
NFC stop command ignores returned error code, what is incorrect due to nodiscard label.
1 parent 99d8680 commit 50daa97

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/lib/shell/commands/NFC.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,16 @@ static CHIP_ERROR NFCHandler(int argc, char ** argv)
5555
{
5656
if (nfcEnabled)
5757
{
58-
chip::DeviceLayer::NFCOnboardingPayloadMgr().StopTagEmulation();
59-
streamer_printf(sout, "NFC tag emulation stopped\r\n");
58+
error = chip::DeviceLayer::NFCOnboardingPayloadMgr().StopTagEmulation();
59+
60+
if (error != CHIP_NO_ERROR)
61+
{
62+
streamer_printf(sout, "Failed to stop NFC tag emulation: %s\r\n", ErrorStr(error));
63+
}
64+
else
65+
{
66+
streamer_printf(sout, "NFC tag emulation stopped\r\n");
67+
}
6068
}
6169
else
6270
{

0 commit comments

Comments
 (0)