WaitForCameraState function waits until the camera settles down in a given camera state. If no camera name is given, then the first connected camera is taken.
cameraStateName: The camera state type.
cameraStateValue: The camera state value we are waiting for.
timeoutMilliseconds: The maximum time waited until the operation is canceled.
cameraName: The camera name of the camera on which the function should be executed. If left empty, then the first connected camera is taken.
bool: WaitForCameraState(string cameraStateName, string cameraStateValue, int timeoutMilliseconds[, string cameraName = ""])
var result = WaitForCameraState("ConnectionState", "connected", 5000, "GoPro Hero 4"); // If the camera is in "connected" state then the function immediately returns true. // Else the function waits until the camera settles down in "connected" state, // or if the timeout of 5 seconds has passed. // If the camera is not in the expected camera state value "connected" after // the timeout then false is returned.