/*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
*
* Copyright (C) 2011-2012 Uwe Hermann <uwe@hermann-uwe.de>
*
{
struct dev_context *devc;
+ if (sdi->status != SR_ST_ACTIVE)
+ return SR_ERR_DEV_CLOSED;
+
if (!(devc = sdi->priv)) {
sr_err("%s: sdi->priv was NULL.", __func__);
return SR_ERR_BUG;
uint8_t buf[4];
int bytes_written;
+ if (sdi->status != SR_ST_ACTIVE)
+ return SR_ERR_DEV_CLOSED;
+
if (!(devc = sdi->priv)) {
sr_err("%s: sdi->priv was NULL.", __func__);
return SR_ERR_BUG;