Skip to content

Commit 3c4d976

Browse files
committed
Add RPC wait for device
Signed-off-by: stas.bucik <[email protected]>
1 parent 22302b6 commit 3c4d976

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/device/DeviceBase.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,9 +1697,16 @@ bool DeviceBase::startPipelineImpl(const Pipeline& pipeline) {
16971697
logCollection::logPipeline(schema, deviceInfo);
16981698
this->pipelineSchema = schema; // Save the schema so it can be saved alongside the crashdump
16991699

1700-
// Build and start the pipeline
17011700
bool success = false;
17021701
std::string errorMsg;
1702+
1703+
std::tie(success, errorMsg) = pimpl->rpcCall(std::chrono::seconds(60), "waitForDeviceReady").as<std::tuple<bool, std::string>>();
1704+
1705+
if (!success) {
1706+
throw std::runtime_error("Device not ready: " + errorMsg);
1707+
}
1708+
1709+
// Build and start the pipeline
17031710
std::tie(success, errorMsg) = pimpl->rpcCall("buildPipeline").as<std::tuple<bool, std::string>>();
17041711
if(success) {
17051712
pimpl->rpcCall("startPipeline");

0 commit comments

Comments
 (0)