From 559e441cc4e48e372c195186ac844060fac2ad2d Mon Sep 17 00:00:00 2001 From: rgoliver Date: Fri, 3 Feb 2023 21:52:25 -0500 Subject: [PATCH] Rpc: Make GetSerialNumber optional (#24851) GetSerialNumber previously returned an error if not provided, this is optional in the spec and should just not return the value if it is not available. --- examples/common/pigweed/rpc_services/Device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common/pigweed/rpc_services/Device.h b/examples/common/pigweed/rpc_services/Device.h index 1427d48d391431..e82095a59a309e 100644 --- a/examples/common/pigweed/rpc_services/Device.h +++ b/examples/common/pigweed/rpc_services/Device.h @@ -372,7 +372,7 @@ class Device : public pw_rpc::nanopb::Device::Service if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetSerialNumber(response.serial_number, sizeof(response.serial_number)) != CHIP_NO_ERROR) { - return pw::Status::Internal(); + response.serial_number[0] = '\0'; // optional serial field not set. } // Create buffer for QR code that can fit max size and null terminator.