X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fcenter-3xx%2Fapi.c;h=9e618777a8bcaae462bcb1e6482b0d7f9f4d6fc8;hb=c3cd66a00cdb4afbd43108563d979eebfbafaf69;hp=6b9c0e3981caba693e5de4187dd0a24b1bd73a25;hpb=15a5bfe4815f9991a9bb532c05d6244a1818a0e4;p=libsigrok.git
diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c
index 6b9c0e39..9e618777 100644
--- a/src/hardware/center-3xx/api.c
+++ b/src/hardware/center-3xx/api.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include
@@ -62,14 +61,12 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
struct sr_dev_inst *sdi;
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- GSList *devices;
serial = sr_serial_dev_inst_new(conn, serialcomm);
if (serial_open(serial, SERIAL_RDWR) != SR_OK)
return NULL;
- devices = NULL;
serial_flush(serial);
sr_info("Found device on port %s.", conn);
@@ -86,11 +83,9 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
for (i = 0; i < center_devs[idx].num_channels; i++)
sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]);
- devices = g_slist_append(devices, sdi);
-
serial_close(serial);
- return devices;
+ return g_slist_append(NULL, sdi);
}
static GSList *scan(GSList *options, int idx)
@@ -132,9 +127,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
(void)cg;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
return sr_sw_limits_config_set(&devc->sw_limits, key, data);
@@ -170,14 +162,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->sw_limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 500ms, or whenever some data comes in. */
serial = sdi->conn;
@@ -187,12 +176,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
return SR_OK;
}
-static int dev_acquisition_stop(struct sr_dev_inst *sdi)
-{
- return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
-}
-
/* Driver-specific API function wrappers */
#define HW_SCAN(X) \
static GSList *scan_##X(struct sr_dev_driver *d, GSList *options) { \
@@ -219,7 +202,7 @@ static struct sr_dev_driver ID##_driver_info = { \
.dev_open = std_serial_dev_open, \
.dev_close = std_serial_dev_close, \
.dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
- .dev_acquisition_stop = dev_acquisition_stop, \
+ .dev_acquisition_stop = std_serial_dev_acquisition_stop, \
.context = NULL, \
}; \
SR_REGISTER_DEV_DRIVER(ID##_driver_info);