+ switch (protocol) {
+ case PROTOCOL_V1:
+ case PROTOCOL_V2:
+ /* V1 and V2 do not have segmented data */
+ sr_err("Data source 'Segmented' not supported on this model");
+ break;
+ case PROTOCOL_V3:
+ case PROTOCOL_V4:
+ {
+ int frames = 0;
+ if (sr_scpi_get_int(sdi->conn,
+ protocol == PROTOCOL_V4 ? "FUNC:WREP:FEND?" :
+ "FUNC:WREP:FMAX?", &frames) != SR_OK)
+ return SR_ERR;
+ if (frames <= 0) {
+ sr_err("No segmented data available");
+ return SR_ERR;
+ }
+ devc->num_frames_segmented = frames;
+ break;
+ }
+ case PROTOCOL_V5:
+ /* The frame limit has to be read on the fly, just set up
+ * reading of the first frame */
+ if (rigol_ds_config_set(sdi, "REC:CURR 1") != SR_OK)
+ return SR_ERR;
+ break;
+ default:
+ sr_err("Data source 'Segmented' not yet supported");
+ return SR_ERR;
+ }