X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fgwinstek-gds-800%2Fapi.c;h=22ac40e6c77ef0192e64601f24d53abf8aecd00c;hb=24a953382c4c07f4071a36897bf17c93db9ce1e7;hp=82fbf958cef0f5451ab8f23a09a50edf916051a2;hpb=e66d1892d0dd16ed166fc8f13493f95de0607362;p=libsigrok.git diff --git a/src/hardware/gwinstek-gds-800/api.c b/src/hardware/gwinstek-gds-800/api.c index 82fbf958..22ac40e6 100644 --- a/src/hardware/gwinstek-gds-800/api.c +++ b/src/hardware/gwinstek-gds-800/api.c @@ -25,9 +25,12 @@ static const uint32_t scanopts[] = { SR_CONF_SERIALCOMM, }; -static const uint32_t devopts[] = { +static const uint32_t drvopts[] = { SR_CONF_OSCILLOSCOPE, - SR_CONF_LIMIT_FRAMES | SR_CONF_SET, +}; + +static const uint32_t devopts[] = { + SR_CONF_LIMIT_FRAMES | SR_CONF_GET | SR_CONF_SET, SR_CONF_SAMPLERATE | SR_CONF_GET, }; @@ -113,8 +116,8 @@ static int dev_close(struct sr_dev_inst *sdi) return sr_scpi_close(scpi); } -static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_get(uint32_t key, GVariant **data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; @@ -129,6 +132,9 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s case SR_CONF_SAMPLERATE: *data = g_variant_new_uint64(devc->sample_rate); break; + case SR_CONF_LIMIT_FRAMES: + *data = g_variant_new_uint64(devc->frame_limit); + break; default: return SR_ERR_NA; } @@ -136,8 +142,8 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s return SR_OK; } -static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_set(uint32_t key, GVariant *data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; @@ -159,10 +165,10 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd return SR_OK; } -static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_channel_group *cg) +static int config_list(uint32_t key, GVariant **data, + const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { - return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, NULL, devopts); + return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); } static int dev_acquisition_start(const struct sr_dev_inst *sdi) @@ -186,17 +192,13 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) { struct sr_scpi_dev_inst *scpi; struct dev_context *devc; - struct sr_datafeed_packet packet; scpi = sdi->conn; devc = sdi->priv; if (devc->df_started) { - packet.type = SR_DF_FRAME_END; - sr_session_send(sdi, &packet); - + std_session_send_df_frame_end(sdi); std_session_send_df_end(sdi); - devc->df_started = FALSE; }