2 * This file is part of the libsigrok project.
4 * Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 SR_PRIV struct sr_dev_driver center_3xx_driver_info;
24 static struct sr_dev_driver *di = ¢er_3xx_driver_info;
26 static int init(struct sr_context *sr_ctx)
28 return std_init(sr_ctx, di, LOG_PREFIX);
31 static GSList *scan(GSList *options)
33 struct drv_context *drvc;
40 drvc->instances = NULL;
45 static GSList *dev_list(void)
47 return ((struct drv_context *)(di->priv))->instances;
50 static int dev_clear(void)
52 return std_dev_clear(di, NULL);
55 static int dev_open(struct sr_dev_inst *sdi)
59 sdi->status = SR_ST_ACTIVE;
64 static int dev_close(struct sr_dev_inst *sdi)
68 sdi->status = SR_ST_INACTIVE;
73 static int cleanup(void)
78 static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi)
94 static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi)
100 if (sdi->status != SR_ST_ACTIVE)
101 return SR_ERR_DEV_CLOSED;
112 static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
128 static int dev_acquisition_start(const struct sr_dev_inst *sdi,
134 if (sdi->status != SR_ST_ACTIVE)
135 return SR_ERR_DEV_CLOSED;
140 static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
144 if (sdi->status != SR_ST_ACTIVE)
145 return SR_ERR_DEV_CLOSED;
150 SR_PRIV struct sr_dev_driver center_3xx_driver_info = {
151 .name = "center-3xx",
152 .longname = "Center 3xx",
157 .dev_list = dev_list,
158 .dev_clear = dev_clear,
159 .config_get = config_get,
160 .config_set = config_set,
161 .config_list = config_list,
162 .dev_open = dev_open,
163 .dev_close = dev_close,
164 .dev_acquisition_start = dev_acquisition_start,
165 .dev_acquisition_stop = dev_acquisition_stop,