#include "libsigrok-internal.h"
#include "ols.h"
-#ifdef _WIN32
-#define O_NONBLOCK FIONBIO
-#endif
-
#define SERIALCOMM "115200/8n1"
static const int hwcaps[] = {
return sdi;
}
-static int hw_init(void)
+static int hw_init(struct sr_context *sr_ctx)
{
struct drv_context *drvc;
break;
}
}
- if (!conn) {
- sr_err("ols: No serial port specified.");
+ if (!conn)
return NULL;
- }
if (serialcomm == NULL)
serialcomm = SERIALCOMM;
* have a match.
*/
sr_info("ols: probing %s .", conn);
- if (serial_open(serial, O_RDWR | O_NONBLOCK) != SR_OK)
+ if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
return NULL;
ret = SR_OK;
devc = sdi->priv;
- if (serial_open(devc->serial, O_RDWR) != SR_OK)
+ if (serial_open(devc->serial, SERIAL_RDWR) != SR_OK)
return SR_ERR;
sdi->status = SR_ST_ACTIVE;