static int init(struct sr_output *o)
{
struct context *ctx;
- struct probe *probe;
+ struct sr_probe *probe;
GSList *l;
uint64_t samplerate;
unsigned int i;
num_probes = g_slist_length(o->device->probes);
comment[0] = '\0';
- if (o->device->plugin) {
+ if (o->device->plugin && sr_device_has_hwcap(o->device, SR_HWCAP_SAMPLERATE)) {
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
- o->device->plugin_index, DI_CUR_SAMPLERATE));
+ o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!(frequency_s = sr_samplerate_string(samplerate))) {
free(ctx->header);
free(ctx);
ctx = o->internal;
switch (event_type) {
- case DF_TRIGGER:
+ case SR_DF_TRIGGER:
/* TODO: can a trigger mark be in a gnuplot data file? */
break;
- case DF_END:
+ case SR_DF_END:
free(o->internal);
o->internal = NULL;
break;
return SR_OK;
}
+struct sr_output_format output_gnuplot = {
+ "gnuplot",
+ "Gnuplot",
+ SR_DF_LOGIC,
+ init,
+ data,
+ event,
+};
+
+/* Temporarily disabled. */
+#if 0
static int analog_init(struct sr_output *o)
{
struct context *ctx;
- struct probe *probe;
+ struct sr_probe *probe;
GSList *l;
uint64_t samplerate;
unsigned int i;
num_probes = g_slist_length(o->device->probes);
comment[0] = '\0';
- if (o->device->plugin) {
+ if (o->device->plugin && sr_device_has_hwcap(o->device, SR_HWCAP_SAMPLERATE)) {
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
- o->device->plugin_index, DI_CUR_SAMPLERATE));
+ o->device->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!(frequency_s = sr_samplerate_string(samplerate))) {
free(ctx->header);
free(ctx);
return SR_OK;
}
-struct sr_output_format output_gnuplot = {
- "gnuplot",
- "Gnuplot",
- DF_LOGIC,
- init,
- data,
- event,
-};
-
struct sr_output_format output_analog_gnuplot = {
"analog_gnuplot",
"Gnuplot analog",
- DF_ANALOG,
+ SR_DF_ANALOG,
analog_init,
analog_data,
event,
};
+#endif