X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=source%2Fdrv-api.c;h=dbeea02fc826207e771ed104d85f84228202362c;hb=2ef7b331cd4468e128c823cc7a055bdef97ee33b;hp=f9e990b8db3a80fad4e97cedd8437d417b5bacef;hpb=126eded091582d9b988d793141d6c428bc38457d;p=sigrok-util.git diff --git a/source/drv-api.c b/source/drv-api.c index f9e990b..dbeea02 100644 --- a/source/drv-api.c +++ b/source/drv-api.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) ${year} ${author} <${email}> * @@ -20,10 +20,9 @@ #include #include "libsigrok.h" #include "libsigrok-internal.h" -#include "config.h" #include "protocol.h" -SR_PRIV struct sr_dev_driver driver_info; +SR_PRIV struct sr_dev_driver ${lib}_driver_info; static struct sr_dev_driver *di = &${lib}_driver_info; /* Properly close and free all devices. */ @@ -57,7 +56,7 @@ static int hw_init(void) struct drv_context *drvc; if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) { - sr_err("${short}: Driver context malloc failed."); + sr_err("Driver context malloc failed."); return SR_ERR; } @@ -122,6 +121,7 @@ static int hw_info_get(int info_id, const void **data, switch (info_id) { /* TODO */ default: + sr_err("Unknown info_id: %d.", info_id); return SR_ERR_ARG; } @@ -133,13 +133,16 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap, { int ret; - if (sdi->status != SR_ST_ACTIVE) + if (sdi->status != SR_ST_ACTIVE) { + sr_err("Device inactive, can't set config options."); return SR_ERR; + } ret = SR_OK; switch (hwcap) { /* TODO */ default: + sr_err("Unknown hardware capability: %d.", hwcap); ret = SR_ERR_ARG; } @@ -159,8 +162,10 @@ static int hw_dev_acquisition_stop(const struct sr_dev_inst *sdi, { (void)cb_data; - if (sdi->status != SR_ST_ACTIVE) + if (sdi->status != SR_ST_ACTIVE) { + sr_err("Device inactive, can't stop acquisition."); return SR_ERR; + } /* TODO */