struct drv_context *drvc;
if (!di) {
- sr_err("%sInvalid driver, cannot initialize.", prefix);
+ sr_err("%s: Invalid driver, cannot initialize.", prefix);
return SR_ERR_ARG;
}
if (!(drvc = g_try_malloc(sizeof(struct drv_context)))) {
- sr_err("%sDriver context malloc failed.", prefix);
+ sr_err("%s: Driver context malloc failed.", prefix);
return SR_ERR_MALLOC;
}
return SR_ERR_ARG;
}
- sr_dbg("%sStarting acquisition.", prefix);
+ sr_dbg("%s: Starting acquisition.", prefix);
/* Send header packet to the session bus. */
- sr_dbg("%sSending SR_DF_HEADER packet.", prefix);
+ sr_dbg("%s: Sending SR_DF_HEADER packet.", prefix);
packet.type = SR_DF_HEADER;
packet.payload = (uint8_t *)&header;
header.feed_version = 1;
gettimeofday(&header.starttime, NULL);
if ((ret = sr_session_send(sdi, &packet)) < 0) {
- sr_err("%sFailed to send header packet: %d.", prefix, ret);
+ sr_err("%s: Failed to send header packet: %d.", prefix, ret);
return ret;
}
#ifdef HAVE_LIBSERIALPORT
-/*
+/**
* Standard serial driver dev_open() helper.
*
* This function can be used to implement the dev_open() driver API
return SR_OK;
}
-/*
+/**
* Standard serial driver dev_close() helper.
*
* This function can be used to implement the dev_close() driver API
return SR_OK;
}
-/*
+/**
* Standard sr_session_stop() API helper.
*
* This function can be used to simplify most (serial port based) driver's
* Must not be NULL.
* @param serial The serial device instance (struct serial_dev_inst *).
* Must not be NULL.
- * @param prefix A driver-specific prefix string used for log messages.
+ * @param[in] prefix A driver-specific prefix string used for log messages.
* Must not be NULL. An empty string is allowed.
*
* @retval SR_OK Success.
}
if (sdi->status != SR_ST_ACTIVE) {
- sr_err("%sDevice inactive, can't stop acquisition.", prefix);
+ sr_err("%s: Device inactive, can't stop acquisition.", prefix);
return SR_ERR_DEV_CLOSED;
}
- sr_dbg("%sStopping acquisition.", prefix);
+ sr_dbg("%s: Stopping acquisition.", prefix);
if ((ret = serial_source_remove(serial)) < 0) {
- sr_err("%sFailed to remove source: %d.", prefix, ret);
+ sr_err("%s: Failed to remove source: %d.", prefix, ret);
return ret;
}
if ((ret = dev_close_fn(sdi)) < 0) {
- sr_err("%sFailed to close device: %d.", prefix, ret);
+ sr_err("%s: Failed to close device: %d.", prefix, ret);
return ret;
}
/* Send SR_DF_END packet to the session bus. */
- sr_dbg("%sSending SR_DF_END packet.", prefix);
+ sr_dbg("%s: Sending SR_DF_END packet.", prefix);
packet.type = SR_DF_END;
packet.payload = NULL;
if ((ret = sr_session_send(cb_data, &packet)) < 0) {
- sr_err("%sFailed to send SR_DF_END packet: %d.", prefix, ret);
+ sr_err("%s: Failed to send SR_DF_END packet: %d.", prefix, ret);
return ret;
}
#endif
-/*
+/**
* Standard driver dev_clear() helper.
*
+ * Clear driver, this means, close all instances.
+ *
* This function can be used to implement the dev_clear() driver API
* callback. dev_close() is called before every sr_dev_inst is cleared.
*
return ret;
}
-