Skip to content

Commit

Permalink
rpc: remove the fallback options for device info in rpc service (#23175)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamdp authored and pull[bot] committed Jan 25, 2023
1 parent f373a4c commit 1221563
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
}
else
{
response.vendor_id = CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID;
return pw::Status::Internal();
}

uint16_t product_id;
Expand All @@ -327,7 +327,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
}
else
{
response.product_id = CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID;
return pw::Status::Internal();
}

uint32_t software_version;
Expand All @@ -337,14 +337,13 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
}
else
{
response.software_version = CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION;
return pw::Status::Internal();
}

if (DeviceLayer::ConfigurationMgr().GetSoftwareVersionString(response.software_version_string,
sizeof(response.software_version_string)) != CHIP_NO_ERROR)
{
snprintf(response.software_version_string, sizeof(response.software_version_string),
CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
return pw::Status::Internal();
}

uint32_t code;
Expand All @@ -364,7 +363,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetSerialNumber(response.serial_number, sizeof(response.serial_number)) !=
CHIP_NO_ERROR)
{
snprintf(response.serial_number, sizeof(response.serial_number), CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER);
return pw::Status::Internal();
}

// Create buffer for QR code that can fit max size and null terminator.
Expand Down

0 comments on commit 1221563

Please sign in to comment.