return -1;
rd = read(fd, eeprom_buf, EEPROM_SIZE);
- g_close(fd, NULL);
+ close(fd);
if (rd != EEPROM_SIZE)
return -1;
SR_PRIV int bl_acme_open_channel(struct sr_channel *ch)
{
struct channel_priv *chp;
- char path[64], *file;
+ char path[64];
+ const char *file;
int fd;
chp = ch->priv;
uint32_t cur_time, elapsed_time;
uint64_t nrexpiration;
struct sr_datafeed_packet packet, framep;
- struct sr_datafeed_analog analog;
+ struct sr_datafeed_analog_old analog;
struct sr_dev_inst *sdi;
struct sr_channel *ch;
struct channel_priv *chp;
if (!devc)
return TRUE;
- packet.type = SR_DF_ANALOG;
+ packet.type = SR_DF_ANALOG_OLD;
packet.payload = &analog;
- memset(&analog, 0, sizeof(struct sr_datafeed_analog));
+ memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
if (read(devc->timer_fd, &nrexpiration, sizeof(nrexpiration)) < 0) {
sr_warn("Failed to read timer information");
*/
for (i = 0; i < nrexpiration; i++) {
framep.type = SR_DF_FRAME_BEGIN;
- sr_session_send(cb_data, &framep);
+ sr_session_send(sdi, &framep);
/*
* Due to different units used in each channel we're sending
chp->val = read_sample(ch);
analog.data = &chp->val;
- sr_session_send(cb_data, &packet);
+ sr_session_send(sdi, &packet);
}
framep.type = SR_DF_FRAME_END;
- sr_session_send(cb_data, &framep);
+ sr_session_send(sdi, &framep);
}
devc->samples_read++;
if (devc->limit_samples > 0 &&
devc->samples_read >= devc->limit_samples) {
sr_info("Requested number of samples reached.");
- sdi->driver->dev_acquisition_stop(sdi, cb_data);
+ sdi->driver->dev_acquisition_stop(sdi);
devc->last_sample_fin = g_get_monotonic_time();
return TRUE;
} else if (devc->limit_msec > 0) {
if (elapsed_time >= devc->limit_msec) {
sr_info("Sampling time limit reached.");
- sdi->driver->dev_acquisition_stop(sdi, cb_data);
+ sdi->driver->dev_acquisition_stop(sdi);
devc->last_sample_fin = g_get_monotonic_time();
return TRUE;
}