* PROTOCOL, epson-desc.c, library.c, nikon-desc.c
* olympus-desc.c, sierra-desc.h, sierra.c, sierra.h: Add changes to support the 0x6 get register strings, the extended protocol. This gives roughly twice the download speed. This is not supported for the default cases. Thanks to Selmeczi David <david@esr.elte.hu> for discovering and coding up the original patch for this support. Also includes a minor change in library.c for the message when a recursive call is detected. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5521 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
2002-11-01 Patrick Mansfield <patmans@users.sourceforge.net>
|
||||
* PROTOCOL, epson-desc.c, library.c, nikon-desc.c
|
||||
* olympus-desc.c, sierra-desc.h, sierra.c, sierra.h: Add changes to
|
||||
support the 0x6 get register strings, the extended protocol.
|
||||
This gives roughly twice the download speed. This is not
|
||||
supported for the default cases. Thanks to Selmeczi David
|
||||
<david@esr.elte.hu> for discovering and coding up the original
|
||||
patch for this support. Also includes a minor change in
|
||||
library.c for the message when a recursive call is detected.
|
||||
|
||||
2002-10-27 Patrick Mansfield <patmans@users.sourceforge.net>
|
||||
* library.c: rename ifdef around recursive call problem, and
|
||||
change ifdef-ed out code to use gp_context_progress_start.
|
||||
|
||||
@@ -73,4 +73,4 @@ For further information , see http://photopc.sourceforge.net/protocol.html.
|
||||
|
||||
03 yy zz... set string register yy to value zz...
|
||||
04 yy get string register yy
|
||||
|
||||
06 yy get string register yy using 32k packets (USB, extended protocol)
|
||||
|
||||
@@ -556,4 +556,4 @@ N_(
|
||||
" please send a mail to <gphoto-devel@gphoto.org> (in English)\n"
|
||||
);
|
||||
|
||||
const CameraDescType ep3000z_cam_desc = { ep3000z_desc, ep3000z_manual };
|
||||
const CameraDescType ep3000z_cam_desc = { ep3000z_desc, ep3000z_manual, TRUE, };
|
||||
|
||||
@@ -501,7 +501,7 @@ sierra_read_packet (Camera *camera, unsigned char *packet, GPContext *context)
|
||||
|
||||
switch (camera->port->type) {
|
||||
case GP_PORT_USB:
|
||||
blocksize = 2054;
|
||||
blocksize = 32774;
|
||||
break;
|
||||
case GP_PORT_SERIAL:
|
||||
blocksize = 1;
|
||||
@@ -1168,18 +1168,21 @@ int sierra_get_string_register (Camera *camera, int reg, int fnumber,
|
||||
CameraFile *file, unsigned char *b,
|
||||
unsigned int *b_len, GPContext *context)
|
||||
{
|
||||
unsigned char p[4096];
|
||||
unsigned char p[34816];
|
||||
const char *file_name;
|
||||
unsigned int packlength, total = *b_len;
|
||||
unsigned int id = 0;
|
||||
int retries, r;
|
||||
static int in_function = 0;
|
||||
|
||||
GP_DEBUG ("sierra_get_string_register: reg %i, file number %i",
|
||||
reg, fnumber);
|
||||
GP_DEBUG ("sierra_get_string_register: reg %i, file number %i,"
|
||||
" ext protocol %x", reg, fnumber,
|
||||
camera->pl->use_extended_protocol);
|
||||
|
||||
if (in_function != 0) {
|
||||
GP_DEBUG ("sierra_get_string_register called recursively!\n");
|
||||
gp_context_error (context, _("recursive calls are not"
|
||||
" supported by the sierra driver! Please contact"
|
||||
" <gphoto-devel@gphoto.org>."));
|
||||
return GP_ERROR;
|
||||
}
|
||||
in_function = 1;
|
||||
@@ -1190,7 +1193,12 @@ int sierra_get_string_register (Camera *camera, int reg, int fnumber,
|
||||
|
||||
/* Build and send the request */
|
||||
CHECK (sierra_build_packet (camera, SIERRA_PACKET_COMMAND, 0, 2, p));
|
||||
p[4] = 0x04;
|
||||
/*
|
||||
* If the extended protocol is enabled, use code 0x06 so we can send
|
||||
* and receive 32k size packages, otherwise code 0x04 is used and
|
||||
* we have 2k size packages.
|
||||
*/
|
||||
p[4] = camera->pl->use_extended_protocol ? 0x06 : 0x04;
|
||||
p[5] = reg;
|
||||
CHECK (sierra_write_packet (camera, p, context));
|
||||
|
||||
|
||||
@@ -625,6 +625,5 @@ N_(
|
||||
" The download should function correctly.\n"
|
||||
);
|
||||
|
||||
|
||||
const CameraDescType cp880_cam_desc = { cp880_desc, cp880_manual };
|
||||
const CameraDescType cp995_cam_desc = { cp880_desc, cp995_manual };
|
||||
const CameraDescType cp880_cam_desc = { cp880_desc, cp880_manual, TRUE, };
|
||||
const CameraDescType cp995_cam_desc = { cp880_desc, cp995_manual, TRUE, };
|
||||
|
||||
@@ -587,5 +587,6 @@ N_(
|
||||
" please contact gphoto-devel@gphoto.net\n"
|
||||
);
|
||||
|
||||
const CameraDescType oly3040_cam_desc = { oly3040_desc, oly3040_manual };
|
||||
const CameraDescType sierra_default_cam_desc = { oly3040_desc, default_manual };
|
||||
const CameraDescType oly3040_cam_desc = { oly3040_desc, oly3040_manual, TRUE, };
|
||||
const CameraDescType sierra_default_cam_desc = { oly3040_desc, default_manual,
|
||||
FALSE, };
|
||||
|
||||
@@ -127,6 +127,7 @@ typedef struct CameraRegisterSet {
|
||||
typedef struct CameraDesc {
|
||||
const CameraRegisterSetType *regset;
|
||||
const char * const manual;
|
||||
const unsigned use_extended_protocol:1;
|
||||
} CameraDescType;
|
||||
|
||||
extern const CameraDescType sierra_default_cam_desc;
|
||||
|
||||
@@ -1956,6 +1956,7 @@ camera_init (Camera *camera, GPContext *context)
|
||||
camera->pl->model = SIERRA_MODEL_DEFAULT;
|
||||
camera->pl->first_packet = 1;
|
||||
camera->pl->usb_wrap = 0;
|
||||
camera->pl->use_extended_protocol = 0;
|
||||
|
||||
/* Retrieve Camera information from name */
|
||||
gp_camera_get_abilities (camera, &a);
|
||||
@@ -1983,6 +1984,8 @@ camera_init (Camera *camera, GPContext *context)
|
||||
return (GP_ERROR_MODEL_NOT_FOUND);
|
||||
}
|
||||
camera->pl->cam_desc = cam_desc;
|
||||
camera->pl->use_extended_protocol =
|
||||
cam_desc->use_extended_protocol;
|
||||
camera->functions->get_config = camera_get_config_cam_desc;
|
||||
camera->functions->set_config = camera_set_config_cam_desc;
|
||||
break;
|
||||
|
||||
@@ -11,7 +11,8 @@ struct _CameraPrivateLibrary {
|
||||
int folders;
|
||||
int speed;
|
||||
int first_packet;
|
||||
int usb_wrap; /* 0: packets sent "raw", 1: see sierra-usbwrap.h */
|
||||
int usb_wrap:1; /* 0: packets sent "raw", 1: see sierra-usbwrap.h */
|
||||
int use_extended_protocol:1;
|
||||
struct CameraDesc const *cam_desc;
|
||||
char folder[128];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user