g_variant_new_uint64(devc->buf[7] * 1000));
meta.config = g_slist_append(NULL, src);
sr_session_send(sdi, &packet);
- g_free(src);
+ g_slist_free(meta.config);
+ sr_config_free(src);
devc->buf_len = 0;
}
} else if (devc->state == ST_GET_LOG_RECORD_DATA) {
} else {
/* Tell device to start transferring from memory. */
cmd = CMD_TRANSFER_MEMORY;
- serial_write_nonblocking(serial, &cmd, 1);
+ serial_write_blocking(serial, &cmd, 1, 0);
}
}
}
* only thing to do is wait for the token that will confirm
* whether the command worked or not, and resend if needed. */
while (TRUE) {
- if (serial_write_nonblocking(serial, (const void *)&cmd, 1) != 1)
+ if (serial_write_blocking(serial, (const void *)&cmd, 1, 0) < 0)
return SR_ERR;
if (wait_for_token(sdi, tokens, timeout) == SR_ERR)
return SR_ERR;
cmd = CMD_TOGGLE_POWER_OFF;
while (TRUE) {
serial_flush(serial);
- if (serial_write_nonblocking(serial, (const void *)&cmd, 1) != 1)
+ if (serial_write_blocking(serial, (const void *)&cmd, 1, 0) < 0)
return SR_ERR;
/* It never takes more than 23ms for the next token to arrive. */
g_usleep(25 * 1000);