The usbrelay command is async, hence we cannot immediately after changing the state check if it became active. Instead, we need to poll for some time and report back either if the state changed, or on timeout. To leave sufficent time for other parts of the code, we check until half of the RPC timeout is expired.
The usbrelay command is async, hence we cannot immediately after changing the state check if it became active. Instead, we need to poll for some time and report back either if the state changed, or on timeout. To leave sufficent time for other parts of the code, we check until half of the RPC timeout is expired.