From 3414f72f605efd64061626e60c8540a92135858a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 30 Dec 2022 22:26:39 +0100 Subject: [PATCH] Remove the model number from the vtpro struct The model number is now also available in the common struct. There is no need to store it twice. The auto-detected model number from the version table is also more reliable than the one passed by the caller. --- src/oceanic_vtpro.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/oceanic_vtpro.c b/src/oceanic_vtpro.c index 5e11115..ef3d6d1 100644 --- a/src/oceanic_vtpro.c +++ b/src/oceanic_vtpro.c @@ -48,7 +48,6 @@ typedef enum oceanic_vtpro_protocol_t { typedef struct oceanic_vtpro_device_t { oceanic_common_device_t base; dc_iostream_t *iostream; - unsigned int model; oceanic_vtpro_protocol_t protocol; } oceanic_vtpro_device_t; @@ -379,7 +378,7 @@ oceanic_vtpro_device_logbook (dc_device_t *abstract, dc_event_progress_t *progre { oceanic_vtpro_device_t *device = (oceanic_vtpro_device_t *) abstract; - if (device->model == AERIS500AI) { + if (device->base.model == AERIS500AI) { return oceanic_aeris500ai_device_logbook (abstract, progress, logbook); } else { return oceanic_common_device_logbook (abstract, progress, logbook); @@ -410,7 +409,6 @@ oceanic_vtpro_device_open (dc_device_t **out, dc_context_t *context, dc_iostream // Set the default values. device->iostream = iostream; - device->model = model; if (model == AERIS500AI) { device->protocol = INTR; } else {