Garmin: pass the model to the device_open function

We do this for a few other device where we need slightly different behavior,
depending on the specific model.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-10-27 15:07:57 -07:00
parent 0ebd5d3879
commit e1bbdd5e65
3 changed files with 3 additions and 3 deletions

View File

@ -229,7 +229,7 @@ dc_device_open (dc_device_t **out, dc_context_t *context, dc_descriptor_t *descr
// Not merged upstream yet
case DC_FAMILY_GARMIN:
rc = garmin_device_open (&device, context, iostream);
rc = garmin_device_open (&device, context, iostream, dc_descriptor_get_model (descriptor));
break;
case DC_FAMILY_DEEPBLU:
rc = deepblu_device_open (&device, context, iostream);

View File

@ -58,7 +58,7 @@ static const dc_device_vtable_t garmin_device_vtable = {
};
dc_status_t
garmin_device_open (dc_device_t **out, dc_context_t *context, dc_iostream_t *iostream)
garmin_device_open (dc_device_t **out, dc_context_t *context, dc_iostream_t *iostream, unsigned int model)
{
dc_status_t status = DC_STATUS_SUCCESS;
garmin_device_t *device = NULL;

View File

@ -32,7 +32,7 @@ extern "C" {
#endif /* __cplusplus */
dc_status_t
garmin_device_open (dc_device_t **device, dc_context_t *context, dc_iostream_t *iostream);
garmin_device_open (dc_device_t **device, dc_context_t *context, dc_iostream_t *iostream, unsigned int model);
dc_status_t
garmin_parser_create (dc_parser_t **parser, dc_context_t *context);