X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ftondaj-sl-814%2Fapi.c;h=445b4274863a57b9fccae4dea75e0fcdee731624;hb=fbbafc6909a4c3d75f77f1c770ef2e8aaab1b306;hp=f647b6a9f26243cb92481c497ee93eff0c1ec271;hpb=dd5c48a6d567a3cac62c4b0058588273bbeea171;p=libsigrok.git diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index f647b6a9..445b4274 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/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 @@ -41,19 +40,13 @@ static const uint32_t devopts[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { - struct drv_context *drvc; struct dev_context *devc; struct sr_dev_inst *sdi; struct sr_config *src; - GSList *devices, *l; + GSList *l; const char *conn, *serialcomm; struct sr_serial_dev_inst *serial; - drvc = di->context; - drvc->instances = NULL; - - devices = NULL; - conn = serialcomm = NULL; for (l = options; l; l = l->next) { if (!(src = l->data)) { @@ -93,12 +86,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->conn = serial; sdi->priv = devc; - sdi->driver = di; sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1"); - drvc->instances = g_slist_append(drvc->instances, sdi); - devices = g_slist_append(devices, sdi); - return devices; + return std_scan_complete(di, g_slist_append(NULL, sdi)); } static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, @@ -146,8 +136,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - std_session_send_df_header(sdi, LOG_PREFIX); - + std_session_send_df_header(sdi); + sr_sw_limits_acquisition_start(&devc->limits); /* Poll every 500ms, or whenever some data comes in. */ @@ -158,12 +148,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) 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); -} - static struct sr_dev_driver tondaj_sl_814_driver_info = { .name = "tondaj-sl-814", .longname = "Tondaj SL-814", @@ -179,7 +163,7 @@ static struct sr_dev_driver tondaj_sl_814_driver_info = { .dev_open = std_serial_dev_open, .dev_close = std_serial_dev_close, .dev_acquisition_start = dev_acquisition_start, - .dev_acquisition_stop = dev_acquisition_stop, + .dev_acquisition_stop = std_serial_dev_acquisition_stop, .context = NULL, }; SR_REGISTER_DEV_DRIVER(tondaj_sl_814_driver_info);