* This file is part of the libsigrok project.
*
* Copyright (C) 2014 Bert Vermeulen <bert@biot.com>
- * Copyright (C) 2017 Frank Stettner <frank-stettner@gmx.net>
+ * Copyright (C) 2017,2019 Frank Stettner <frank-stettner@gmx.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/* Prime the pipe with the first channel. */
devc->cur_acquisition_channel = sr_next_enabled_channel(sdi, NULL);
+ /* Device specific initialization before aquisition starts. */
+ if (devc->device->init_aquisition)
+ devc->device->init_aquisition(sdi);
+
if ((ret = sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 10,
scpi_pps_receive_data, (void *)sdi)) != SR_OK)
return ret;
* Copyright (C) 2014 Bert Vermeulen <bert@biot.com>
* Copyright (C) 2015 Google, Inc.
* (Written by Alexandru Gagniuc <mrnuke@google.com> for Google, Inc.)
- * Copyright (C) 2017 Frank Stettner <frank-stettner@gmx.net>
+ * Copyright (C) 2017,2019 Frank Stettner <frank-stettner@gmx.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
ARRAY_AND_SIZE(agilent_n5700a_cg),
agilent_n5700a_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Agilent N5767A */
ARRAY_AND_SIZE(agilent_n5700a_cg),
agilent_n5700a_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* BK Precision 9310 */
ARRAY_AND_SIZE(bk_9130_cg),
bk_9130_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Chroma 61604 */
ARRAY_AND_SIZE(chroma_61604_cg),
chroma_61604_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Chroma 62000 series */
NULL, 0,
chroma_62000_cmd,
.probe_channels = chroma_62000p_probe_channels,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* HP 6633A */
ARRAY_AND_SIZE(hp_663xx_cg),
hp_6630a_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* HP 6631B */
ARRAY_AND_SIZE(hp_663xx_cg),
hp_6630b_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* HP 6632B */
ARRAY_AND_SIZE(hp_663xx_cg),
hp_6630b_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* HP 66332A */
ARRAY_AND_SIZE(hp_663xx_cg),
hp_6630b_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* HP 6633B */
ARRAY_AND_SIZE(hp_663xx_cg),
hp_6630b_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* HP 6634B */
ARRAY_AND_SIZE(hp_663xx_cg),
hp_6630b_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Rigol DP700 series */
ARRAY_AND_SIZE(rigol_dp700_cg),
rigol_dp700_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
{ "Rigol", "^DP712$", SCPI_DIALECT_UNKNOWN, 0,
ARRAY_AND_SIZE(rigol_dp700_devopts),
ARRAY_AND_SIZE(rigol_dp700_cg),
rigol_dp700_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Rigol DP800 series */
ARRAY_AND_SIZE(rigol_dp820_cg),
rigol_dp800_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
{ "Rigol", "^DP831A$", SCPI_DIALECT_UNKNOWN, PPS_OTP,
ARRAY_AND_SIZE(rigol_dp800_devopts),
ARRAY_AND_SIZE(rigol_dp830_cg),
rigol_dp800_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
{ "Rigol", "^(DP832|DP832A)$", SCPI_DIALECT_UNKNOWN, PPS_OTP,
ARRAY_AND_SIZE(rigol_dp800_devopts),
ARRAY_AND_SIZE(rigol_dp830_cg),
rigol_dp800_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Philips/Fluke PM2800 series */
NULL, 0,
philips_pm2800_cmd,
philips_pm2800_probe_channels,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
/* Rohde & Schwarz HMC8043 */
ARRAY_AND_SIZE(rs_hmc8043_cg),
rs_hmc8043_cmd,
.probe_channels = NULL,
+ .init_aquisition = NULL,
+ .update_status = NULL,
},
};
* This file is part of the libsigrok project.
*
* Copyright (C) 2014 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2019 Frank Stettner <frank-stettner@gmx.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data)
{
struct dev_context *devc;
+ const struct scpi_pps *device;
struct sr_datafeed_packet packet;
struct sr_datafeed_analog analog;
struct sr_analog_encoding encoding;
if (!(devc = sdi->priv))
return TRUE;
+ if (!(device = devc->device))
+ return TRUE;
+
pch = devc->cur_acquisition_channel->priv;
channel_group_cmd = 0;
channel_group_name = pch->hwname;
}
+ /*
+ * When the current channel is the first in the array, perform the device
+ * specific status update first.
+ */
+ if (devc->cur_acquisition_channel == sr_next_enabled_channel(sdi, NULL) &&
+ device->update_status) {
+ device->update_status(sdi);
+ }
+
if (pch->mq == SR_MQ_VOLTAGE) {
gvtype = G_VARIANT_TYPE_DOUBLE;
cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
* This file is part of the libsigrok project.
*
* Copyright (C) 2014 Bert Vermeulen <bert@biot.com>
- * Copyright (C) 2017 Frank Stettner <frank-stettner@gmx.net>
+ * Copyright (C) 2017,2019 Frank Stettner <frank-stettner@gmx.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
int (*probe_channels) (struct sr_dev_inst *sdi, struct sr_scpi_hw_info *hwinfo,
struct channel_spec **channels, unsigned int *num_channels,
struct channel_group_spec **channel_groups, unsigned int *num_channel_groups);
+ int (*init_aquisition) (const struct sr_dev_inst *sdi);
+ int (*update_status) (const struct sr_dev_inst *sdi);
};
struct channel_spec {