From: Uwe Hermann Date: Wed, 19 Jul 2017 19:41:05 +0000 (+0200) Subject: new-driver: Update to current state of the code-base. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2736322a2a526a82e02316548c7c08cb33fd7cd8;p=sigrok-util.git new-driver: Update to current state of the code-base. --- diff --git a/source/drv-api.c b/source/drv-api.c index 7b90c19..3444fd6 100644 --- a/source/drv-api.c +++ b/source/drv-api.c @@ -20,8 +20,6 @@ #include #include "protocol.h" -SR_PRIV struct sr_dev_driver {lib}_driver_info; - static GSList *scan(struct sr_dev_driver *di, GSList *options) {{ struct drv_context *drvc; @@ -39,11 +37,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) return devices; }} -static int dev_clear(const struct sr_dev_driver *di) -{{ - return std_dev_clear(di, NULL); -}} - static int dev_open(struct sr_dev_inst *sdi) {{ (void)sdi; @@ -86,6 +79,7 @@ static int config_set(uint32_t key, GVariant *data, {{ int ret; + (void)sdi; (void)data; (void)cg; @@ -123,6 +117,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) /* TODO: configure hardware, reset acquisition state, set up * callbacks and send header packet. */ + (void)sdi; + return SR_OK; }} @@ -130,6 +126,8 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) {{ /* TODO: stop acquisition. */ + (void)sdi; + return SR_OK; }} @@ -141,7 +139,7 @@ SR_PRIV struct sr_dev_driver {lib}_driver_info = {{ .cleanup = std_cleanup, .scan = scan, .dev_list = std_dev_list, - .dev_clear = dev_clear, + .dev_clear = std_dev_clear, .config_get = config_get, .config_set = config_set, .config_list = config_list, diff --git a/source/drv-protocol.h b/source/drv-protocol.h index 30d42a5..c417f5d 100644 --- a/source/drv-protocol.h +++ b/source/drv-protocol.h @@ -27,16 +27,7 @@ #define LOG_PREFIX "{short}" -/** Private, per-device-instance driver context. */ struct dev_context {{ - /* Model-specific information */ - - /* Acquisition settings */ - - /* Operational state */ - - /* Temporary state across callbacks */ - }}; SR_PRIV int {lib}_receive_data(int fd, int revents, void *cb_data);