Skip to content

Commit

Permalink
Conditionally implement TriggerOTA in RPC builds (#20318)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored and pull[bot] committed Oct 2, 2023
1 parent 92db3a0 commit 3849875
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>

virtual pw::Status TriggerOta(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
#if CONFIG_CHIP_OTA_REQUESTOR
chip::DeviceLayer::PlatformMgr().ScheduleWork(
[](intptr_t) {
chip::OTARequestorInterface * requestor = chip::GetRequestorInstance();
Expand All @@ -237,6 +238,10 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
},
reinterpret_cast<intptr_t>(nullptr));
return pw::OkStatus();
#else
ChipLogError(AppServer, "Trigger OTA requested, but OTA requestor not compiled in.");
return pw::Status::Unimplemented();
#endif
}

virtual pw::Status SetPairingState(const chip_rpc_PairingState & request, pw_protobuf_Empty & response)
Expand Down

0 comments on commit 3849875

Please sign in to comment.