LivoxProto1:enPcloudData: reorder success case here
This commit is contained in:
@@ -1533,19 +1533,24 @@ protected:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if response indicates success
|
// Check for error first, return early on failure
|
||||||
if (response->command.cmd_set == 0x00 &&
|
if (!(response->command.cmd_set == 0x00 &&
|
||||||
response->command.cmd_id == 0x04 &&
|
response->command.cmd_id == 0x04 &&
|
||||||
response->ret_code == 0x00)
|
response->ret_code == 0x00))
|
||||||
{
|
{
|
||||||
// Set the appropriate pcloud data active state based on command type
|
std::cerr << __func__ << ": Failed to enable pcloud data for dev "
|
||||||
context->setPcloudDataActiveState();
|
"(" << context->device.discoveredDevice.deviceIdentifier
|
||||||
context->callOriginalCallback(true);
|
<< ") @(" << context->device.discoveredDevice.ipAddr << "). "
|
||||||
|
<< "cmd_set: " << (int)response->command.cmd_set
|
||||||
|
<< ", cmd_id: " << (int)response->command.cmd_id
|
||||||
|
<< ", ret_code: " << (int)response->ret_code << "\n";
|
||||||
|
|
||||||
|
context->callOriginalCallbackWithFailure();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we get here, the command failed
|
context->setPcloudDataActiveState();
|
||||||
context->callOriginalCallbackWithFailure();
|
context->callOriginalCallback(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup()
|
void cleanup()
|
||||||
|
|||||||
Reference in New Issue
Block a user