X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fcenter-3xx%2Fapi.c;h=76d234ffd980cff708f793607ca00fa6508a7680;hb=cb828f1b3e00;hp=5e34f696c1f7fc43273c8a07a01a25a84b851ef4;hpb=e66d1892d0dd16ed166fc8f13493f95de0607362;p=libsigrok.git diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c index 5e34f696..76d234ff 100644 --- a/src/hardware/center-3xx/api.c +++ b/src/hardware/center-3xx/api.c @@ -67,8 +67,6 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx) if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - serial_flush(serial); - sr_info("Found device on port %s.", conn); sdi = g_malloc0(sizeof(struct sr_dev_inst)); @@ -109,19 +107,16 @@ static GSList *scan(GSList *options, int idx) if (!conn) return NULL; - if (serialcomm) { - /* Use the provided comm specs. */ + if (serialcomm) devices = center_scan(conn, serialcomm, idx); - } else { - /* Try the default. */ + else devices = center_scan(conn, center_devs[idx].conn, idx); - } return std_scan_complete(center_devs[idx].di, devices); } -static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_set(uint32_t key, GVariant *data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; @@ -132,8 +127,8 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd return sr_sw_limits_config_set(&devc->sw_limits, key, data); } -static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_list(uint32_t key, GVariant **data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); } @@ -149,7 +144,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx) std_session_send_df_header(sdi); - /* Poll every 500ms, or whenever some data comes in. */ serial = sdi->conn; serial_source_add(sdi->session, serial, G_IO_IN, 500, center_devs[idx].receive_data, (void *)sdi);