Beispiel #1
0
int
camera_init (Camera *camera, GPContext *context)
{
        /* First, set up all the function pointers */
        /* camera->functions->exit                 = camera_exit; */
        camera->functions->get_config		= camera_config_get;
        camera->functions->set_config		= camera_config_set;
        camera->functions->capture              = camera_capture;
        camera->functions->summary              = camera_summary;
        camera->functions->manual               = camera_manual;
        camera->functions->about                = camera_about;

	/* Now, tell the filesystem where to get lists, files and info */
	gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera);

	/* Configure port */
	gp_port_set_timeout(camera->port,MDC800_DEFAULT_COMMAND_RETRY_DELAY);
	if (camera->port->type == GP_PORT_SERIAL) {
	    GPPortSettings settings;
	    gp_port_get_settings(camera->port, &settings);
	    settings.serial.speed   = 57600;
	    settings.serial.bits    = 8;
	    settings.serial.parity  = 0;
	    settings.serial.stopbits= 1;
	    gp_port_set_settings(camera->port, settings);
	}
	return mdc800_openCamera(camera);
}
Beispiel #2
0
/*
 * Init this library.
 * usb: 0: rs232   1:usb
 */
int mdc800_initialize ()
{
	int h,s,e;

	if (mdc800_camera_open)
		return 1;

	printAPINote ("-Init---------------------------------------------------------------------------\n");		
	printAPINote ("Serial Port is \"%s\" \n",serial_port);

	if (!mdc800_openCamera (serial_port))
	{
		printAPIError ("(mdc800_initialize) open camera fails.\n");
		return 0;
	}
	
	printAPINote ("\n");
	mdc800_camera_open=1;
	printAPINote ( mdc800_summary () );
	printAPINote ("\n");
	
	if (mdc800_getRemainFreeImageCount (&h,&s,&e))
		printAPINote ("\nFree Memory for H%i S%i E%i\n",h,s,e);

	printAPINote ("-ok-----------------------------------------------------------------------------\n");		
	return 1;
}