From 5e5e8c3fb8598d96e8523ca4efa3eb2afcfdcd40 Mon Sep 17 00:00:00 2001 From: Hubert Figuiere Date: Wed, 15 Jan 2003 00:49:59 +0000 Subject: [PATCH] Camera IDs are now in an array like before git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6101 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/smal/smal.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/camlibs/smal/smal.c b/camlibs/smal/smal.c index 7907644ee..1f998c9c7 100644 --- a/camlibs/smal/smal.c +++ b/camlibs/smal/smal.c @@ -47,31 +47,42 @@ int camera_id (CameraText *id) { - strcpy(id->text, "Smal:Ultrapocket"); + strcpy(id->text, "smal"); return (GP_OK); } + +struct smal_cameras { + char * name; + unsigned short idVendor; + unsigned short idProduct; +} smal_cameras [] = { + { "Fuji:Axia Slimshot", USB_VENDOR_ID_SMAL, USB_DEVICE_ID_ULTRAPOCKET }, + { "Fuji:Axia Eyeplate", USB_VENDOR_ID_SMAL, USB_DEVICE_ID_ULTRAPOCKET }, + { "Logitech:Pocket Digital",USB_VENDOR_ID_SMAL, USB_DEVICE_ID_ULTRAPOCKET }, + { "SMaL:Ultra-Pocket",USB_VENDOR_ID_SMAL, USB_DEVICE_ID_ULTRAPOCKET }, + { NULL, 0, 0 } +}; + int camera_abilities (CameraAbilitiesList *list) { CameraAbilities a; + int i; memset(&a, 0, sizeof(a)); - strcpy(a.model, "Smal:Ultrapocket"); a.status = GP_DRIVER_STATUS_EXPERIMENTAL; /* highly! */ a.port = GP_PORT_USB; a.speed[0] = 0; - a.usb_vendor = USB_VENDOR_ID_SMAL; - a.usb_product = USB_DEVICE_ID_ULTRAPOCKET; a.operations = GP_OPERATION_NONE; a.file_operations = GP_FILE_OPERATION_DELETE; a.folder_operations = GP_FOLDER_OPERATION_DELETE_ALL; - gp_abilities_list_append(list, a); - /* fuji @xia slimshot is just a rebranded SmAL Ultrapocket */ - /* LB: 01/03 - not quite - it's got a different header */ - strcpy(a.model, "Fuji:Slimshot"); - gp_abilities_list_append(list, a); - + for (i = 0; smal_cameras[i].name; i++) { + strcpy(a.model, smal_cameras[i].name); + a.usb_vendor = smal_cameras[i].idVendor; + a.usb_product = smal_cameras[i].idProduct; + gp_abilities_list_append(list, a); + } return (GP_OK); }