From 27c8b178d79a4e51e6ac720c23d3eabb29a8a6e3 Mon Sep 17 00:00:00 2001 From: Philippe Marzouk Date: Sat, 29 Sep 2001 09:50:01 +0000 Subject: [PATCH] added support for PowerShot G2 thanks to Hans Ulrich Niedermann git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2337 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/README | 1 + camlibs/canon/canon.c | 4 ++++ camlibs/canon/psa50.c | 13 ++++++++++++- camlibs/canon/psa50.h | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/camlibs/canon/README b/camlibs/canon/README index 3152d36b3..544b189b4 100644 --- a/camlibs/canon/README +++ b/camlibs/canon/README @@ -9,6 +9,7 @@ following models: - Powershot S300 / Digital IXUS 300 - Powershot IXY Digital 300 (not tested) - Powershot G1 + - Powershot G2 (seems to work like the G1, but we're still testing) - Powershot A10 (not tested) - Powershot A20 (not tested) - Powershot Pro90 IS (not tested) diff --git a/camlibs/canon/canon.c b/camlibs/canon/canon.c index c07fa6a65..78192fbf0 100644 --- a/camlibs/canon/canon.c +++ b/camlibs/canon/canon.c @@ -76,6 +76,7 @@ static struct { { "Canon IXY DIGITAL", 0x04A9, 0x3046, 0 }, { "Canon Digital IXUS", 0x04A9, 0x3047, 0 }, { "Canon PowerShot G1", 0x04A9, 0x3048, 1 }, + { "Canon PowerShot G2", 0x04A9, 0x3055, 0 }, { "Canon PowerShot Pro90 IS", 0x04A9, 0x3049, 1 }, { "Canon IXY DIGITAL 300", 0x04A9, 0x304B, 0 }, { "Canon PowerShot S300", 0x04A9, 0x304C, 0 }, @@ -242,6 +243,8 @@ char *camera_model_string(Camera *camera) return "Powershot S20"; case CANON_PS_G1: return "Powershot G1"; + case CANON_PS_G2: + return "Powershot G2"; case CANON_PS_S100: return "Powershot S100 / Digital IXUS / IXY DIGITAL"; case CANON_PS_S300: @@ -843,6 +846,7 @@ int camera_summary(Camera *camera, CameraText *summary) case CANON_PS_S10: model = "Canon Powershot S10"; break; case CANON_PS_S20: model = "Canon Powershot S20"; break; case CANON_PS_G1: model = "Canon Powershot G1"; break; + case CANON_PS_G2: model = "Canon Powershot G2"; break; case CANON_PS_S100: model = "Canon Powershot S100 / Digital IXUS / IXY DIGITAL"; break; case CANON_PS_S300: model = "Canon Powershot S300 / Digital IXUS 300 / IXY DIGITAL 300"; break; case CANON_PS_A10: model = "Canon Powershot A10"; break; diff --git a/camlibs/canon/psa50.c b/camlibs/canon/psa50.c index 4e9b812a0..c60b743ea 100644 --- a/camlibs/canon/psa50.c +++ b/camlibs/canon/psa50.c @@ -1044,6 +1044,12 @@ int psa50_ready(Camera *camera) A5 = 0; return 1; } + else if (!strcmp("Canon PowerShot G2",cs->ident)) { + gp_frontend_status(camera, "Detected a Powershot G2"); + cs->model = CANON_PS_G2; + A5 = 0; + return 1; + } else if ((!strcmp("Canon DIGITAL IXUS",cs->ident)) || (!strcmp("Canon IXY DIGITAL",cs->ident)) || (!strcmp("Canon PowerShot S110",cs->ident)) @@ -1207,6 +1213,10 @@ int psa50_ready(Camera *camera) gp_frontend_status(camera, "Detected a Powershot G1"); cs->model = CANON_PS_G1; A5 = 0; + } else if (!strcmp("Canon PowerShot G2",psa50_id)) { + gp_frontend_status(camera, "Detected a Powershot G2"); + cs->model = CANON_PS_G2; + A5 = 0; } else if (!strcmp("Canon PowerShot A10",psa50_id)) { gp_frontend_status(camera, "Detected a Powershot A10"); cs->model = CANON_PS_A10; @@ -1529,6 +1539,7 @@ unsigned char *psa50_get_file_serial(Camera *camera, const char *name,int *lengt if (!file) { total = get_int(msg+4); if(cs->model == CANON_PS_S20 || cs->model==CANON_PS_G1 + || cs->model==CANON_PS_G2 || cs->model == CANON_PS_S10) { maxfilesize=10000000; } @@ -1606,7 +1617,7 @@ unsigned char *psa50_get_file_usb(Camera *camera, const char *name,int *length) if (!file) { total=len; if(cs->model == CANON_PS_S10 || cs->model == CANON_PS_S20 - || cs->model == CANON_PS_G1 || cs->model == CANON_PS_S300 + || cs->model == CANON_PS_G2 || cs->model == CANON_PS_G1 || cs->model == CANON_PS_S300 || cs->model == CANON_PS_S100 || cs->model == CANON_PS_A10 || cs->model == CANON_PS_A20 || cs->model == CANON_EOS_D30 || cs->model == CANON_PS_PRO90_IS) { diff --git a/camlibs/canon/psa50.h b/camlibs/canon/psa50.h index f119f9050..8611841cc 100644 --- a/camlibs/canon/psa50.h +++ b/camlibs/canon/psa50.h @@ -47,6 +47,7 @@ typedef enum { CANON_PS_S100, CANON_PS_S300, CANON_PS_G1, + CANON_PS_G2, CANON_PS_A10, CANON_PS_A20, CANON_EOS_D30,