GSList *devices = NULL, *l;
const char *conn = NULL, *serialcomm = NULL;
uint8_t buf[292];
- size_t len = sizeof(buf);
+ size_t len;
+ struct sr_config *src;
+
+ len = sizeof(buf);
for (l = options; l; l = l->next) {
- struct sr_config *src = l->data;
+ src = l->data;
switch (src->key) {
case SR_CONF_CONN:
conn = g_variant_get_string(src->data, NULL);
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_serial_dev_acquisition_stop(sdi, cb_data, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ return std_serial_dev_acquisition_stop(sdi, cb_data,
+ std_serial_dev_close, sdi->conn, LOG_PREFIX);
}
SR_PRIV struct sr_dev_driver teleinfo_driver_info = {
.scan = scan,
.dev_list = dev_list,
.dev_clear = dev_clear,
+ .config_get = NULL,
.config_set = config_set,
.config_list = config_list,
.dev_open = std_serial_dev_open,
.dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
+ .priv = NULL,
};
const uint8_t *group, char *optarif)
{
char label[9], data[13], control, cr;
- const char *str = (const char *) group;
+ const char *str = (const char *)group;
if (sscanf(str, "\x0A%8s %13s %c%c", label, data, &control, &cr) != 4
|| cr != CR)
return FALSE;
const uint8_t *buf, int len,
char *optarif)
{
- const uint8_t *group_start = memchr(buf, LF, len);
+ const uint8_t *group_start, *group_end;
+
+ group_start = memchr(buf, LF, len);
if (!group_start)
return NULL;
- const uint8_t *group_end = memchr(group_start, CR,
- len - (group_start - buf));
+ group_end = memchr(group_start, CR, len - (group_start - buf));
if (!group_end)
return NULL;
struct sr_serial_dev_inst *serial;
const uint8_t *ptr, *next_ptr, *end_ptr;
int len;
+ int64_t time;
(void)fd;
}
if (devc->limit_msec) {
- int64_t time = (g_get_monotonic_time() - devc->start_time) / 1000;
+ time = (g_get_monotonic_time() - devc->start_time) / 1000;
if (time > (int64_t)devc->limit_msec) {
sr_info("Requested time limit reached.");
sdi->driver->dev_acquisition_stop(sdi, devc->session_cb_data);