SR_CONF_SERIALCOMM,
};
-static const uint32_t devopts[] = {
+static const uint32_t drvopts[] = {
SR_CONF_ENERGYMETER,
+};
+
+static const uint32_t devopts[] = {
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET,
sr_info("Probing serial port %s.", conn);
- serial_flush(serial);
-
/* Let's get a bit of data and see if we can find a packet. */
if (serial_stream_detect(serial, buf, &len, len,
- teleinfo_packet_valid, 3000, 1200) != SR_OK)
+ teleinfo_packet_valid, NULL, NULL, 3000) != SR_OK)
goto scan_cleanup;
sr_info("Found device on port %s.", conn);
return std_scan_complete(di, devices);
}
-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;
return sr_sw_limits_config_set(&devc->sw_limits, key, data);
}
-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)
std_session_send_df_header(sdi);
- /* Poll every 50ms, or whenever some data comes in. */
serial_source_add(sdi->session, serial, G_IO_IN, 50,
teleinfo_receive_data, (void *)sdi);