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

rpc: remove the fallback options for device info in rpc service #23175

Merged
merged 1 commit into from
Oct 14, 2022
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
rpc: remove the fallback options for device info in rpc service
  • Loading branch information
shubhamdp committed Oct 13, 2022
commit 04cab9c0ab74f7b915f75901df412b010b7249a7
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