]> sigrok.org Git - libsigrok.git/blobdiff - hardware/openbench-logic-sniffer/ols.c
sr: session: Close a device when it is removed from a session
[libsigrok.git] / hardware / openbench-logic-sniffer / ols.c
index 7cdd77e64076ba2cb898b78cb0f2246fe41bab1e..f2706d11220e17006f4556f2887dffebd1445184 100644 (file)
@@ -38,8 +38,8 @@
 #include <arpa/inet.h>
 #endif
 #include <glib.h>
-#include "sigrok.h"
-#include "sigrok-internal.h"
+#include "libsigrok.h"
+#include "libsigrok-internal.h"
 #include "ols.h"
 
 #ifdef _WIN32
@@ -93,14 +93,14 @@ static const char *probe_names[NUM_PROBES + 1] = {
 };
 
 /* default supported samplerates, can be overridden by device metadata */
-static struct sr_samplerates samplerates = {
+static const struct sr_samplerates samplerates = {
        SR_HZ(10),
        SR_MHZ(200),
        SR_HZ(1),
        NULL,
 };
 
-/* List of struct sr_serial_dev_inst */
+/* List of struct sr_dev_inst. */
 static GSList *dev_insts = NULL;
 
 static int send_shortcommand(int fd, uint8_t command)
@@ -398,7 +398,7 @@ static int hw_init(const char *devinfo)
                fd = serial_open(l->data, O_RDWR | O_NONBLOCK);
                if (fd != -1) {
                        serial_params[devcnt] = serial_backup_params(fd);
-                       serial_set_params(fd, 115200, 8, 0, 1, 2);
+                       serial_set_params(fd, 115200, 8, SERIAL_PARITY_NONE, 1, 2);
                        ret = SR_OK;
                        for (i = 0; i < 5; i++) {
                                if ((ret = send_shortcommand(fd,