#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;
sr_err("ols: driver context malloc failed.");
return SR_ERR_MALLOC;
}
+ drvc->sr_ctx = sr_ctx;
odi->priv = drvc;
return SR_OK;
* 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;