#include <math.h>
#include <string.h>
#include "protocol.h"
-
-/* Forward declarations */
-SR_PRIV struct sr_dev_driver motech_lps_301_driver_info;
SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *buflen);
SR_PRIV int lps_send_va(struct sr_serial_dev_inst *serial, const char *fmt, va_list args);
SR_PRIV int lps_cmd_ok(struct sr_serial_dev_inst *serial, const char *fmt, ...);
static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *options)
{
struct sr_dev_inst *sdi;
- struct drv_context *drvc;
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
struct sr_channel *ch;
conn = serialcomm = NULL;
devices = NULL;
- drvc = drv->context;
- drvc->instances = NULL;
-
sr_spew("scan() called!");
/* Process and check options. */
sdi->vendor = g_strdup(VENDOR_MOTECH);
sdi->model = g_strdup(models[modelid].modelstr);
sdi->version = g_strdup(verstr);
- sdi->driver = drv;
sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
}
- drvc->instances = g_slist_append(drvc->instances, sdi);
devices = g_slist_append(devices, sdi);
/* Query status */
if (!devices)
sr_serial_dev_inst_free(serial);
- return devices;
+ return std_scan_complete(drv, devices);
exit_err:
sr_info("%s: Error!", __func__);
sdi->conn, LOG_PREFIX);
}
-SR_PRIV struct sr_dev_driver motech_lps_301_driver_info = {
+static struct sr_dev_driver motech_lps_301_driver_info = {
.name = "motech-lps-301",
.longname = "Motech LPS-301",
.api_version = 1,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(motech_lps_301_driver_info);