#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
-#include "sigrok.h"
-#include "sigrok-internal.h"
+#include "libsigrok.h"
+#include "libsigrok-internal.h"
#include "genericdmm.h"
extern SR_PRIV struct dmmchip dmmchip_fs9922;
+static struct sr_hwopt victor_70c_vidpid[] = {
+ { SR_HWOPT_CONN, "1244.d237" },
+ { 0, NULL }
+};
static struct dev_profile dev_profiles[] = {
{ "victor-70c", "Victor", "70C", &dmmchip_fs9922,
- 0x1244, 0xd237, DMM_TRANSPORT_USBHID },
- { "mastech-va18b", "Mastech", "VA18B", NULL, 0, 0, DMM_TRANSPORT_SERIAL},
+ DMM_TRANSPORT_USBHID, victor_70c_vidpid
+ },
+ { "mastech-va18b", "Mastech", "VA18B", NULL, DMM_TRANSPORT_SERIAL, NULL},
+ { NULL, NULL, NULL, NULL, 0, NULL }
};
static const int hwcaps[] = {
SR_PRIV libusb_context *genericdmm_usb_context = NULL;
-static int hw_init(const char *devinfo)
+static int hw_init(void)
{
- struct sr_dev_inst *sdi;
- struct context *ctx;
- int devcnt = 0;
-
- /* Avoid compiler warnings. */
- (void)devinfo;
if (libusb_init(&genericdmm_usb_context) != 0) {
sr_err("genericdmm: Failed to initialize USB.");
- return 0;
+ return SR_ERR;
}
+
+ return SR_OK;
+}
+
+static int hw_scan(void)
+{
+ struct sr_dev_inst *sdi;
+ struct context *ctx;
+ int devcnt = 0;
+
if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
sr_err("genericdmm: ctx malloc failed.");
return 0;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
+ .scan = hw_scan,
.dev_open = hw_dev_open,
.dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,