Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_camera_wait_for_event ( Camera camera,
int  timeout,
CameraEventType eventtype,
void **  eventdata,
GPContext context 
)

Wait for an event from the camera.

Parameters:
camera a Camera
timeout amount of time to wait in 1/1000 seconds
eventtype received CameraEventType [out]
eventdata received event specific data [out]
context a GPContext
Returns:
gphoto2 error code
This function blocks and waits for an event to come from the camera. If timeout occurs before an event is received then *eventtype==GP_EVENT_TIMEOUT and eventdata is left unchanged. If an event is received then eventtype is set to the type of event, and eventdata is set to event specific data. See the CameraEventType enum to see which eventtype's match to which types of eventdata.

Definition at line 1030 of file gphoto2-camera.c.

References CHECK_NULL, GP_ERROR_NOT_SUPPORTED, and GP_OK.

{
      CHECK_NULL (camera);
      CHECK_INIT (camera, context);

      if (!camera->functions->wait_for_event) {
            gp_context_error (context, _("This camera does "
                  "not support event handling."));
            CAMERA_UNUSED (camera, context);
                return (GP_ERROR_NOT_SUPPORTED);
      }
      CHECK_RESULT_OPEN_CLOSE (camera, camera->functions->wait_for_event (
                              camera, timeout, eventtype, eventdata,
                              context), context);
      CAMERA_UNUSED (camera, context);
      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index