}
alsa->session_id = session_device_id;
- source_add(ufds[0].fd, ufds[0].events, 10, receive_data, sdi);
+ sr_source_add(ufds[0].fd, ufds[0].events, 10, receive_data, sdi);
packet.type = SR_DF_HEADER;
packet.length = sizeof(struct sr_datafeed_header);
sr_session_bus(session_device_id, &packet);
/* Add capture source. */
- source_add(0, G_IO_IN, 10, receive_data, sdi);
+ sr_source_add(0, G_IO_IN, 10, receive_data, sdi);
sigma->state.state = SIGMA_CAPTURE;
g_io_channel_set_buffered(channels[0], FALSE);
g_io_channel_set_buffered(channels[1], FALSE);
- source_add(mydata->pipe_fds[0], G_IO_IN | G_IO_ERR, 40, receive_data,
- session_device_id);
+ sr_source_add(mydata->pipe_fds[0], G_IO_IN | G_IO_ERR, 40,
+ receive_data, session_device_id);
/* Run the demo thread. */
g_thread_init(NULL);
return ret;
mso->session_id = session_device_id;
- source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sdi);
+ sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sdi);
packet.type = SR_DF_HEADER;
packet.length = sizeof(struct sr_datafeed_header);
* longer than it takes to send a byte, that means it's
* finished. We'll double that to 30ms to be sure...
*/
- source_remove(fd);
- source_add(fd, G_IO_IN, 30, receive_data, user_data);
+ sr_source_remove(fd);
+ sr_source_add(fd, G_IO_IN, 30, receive_data, user_data);
raw_sample_buf = malloc(limit_samples * 4);
/* fill with 1010... for debugging */
memset(raw_sample_buf, 0x82, limit_samples * 4);
if (send_shortcommand(sdi->serial->fd, CMD_RUN) != SR_OK)
return SR_ERR;
- source_add(sdi->serial->fd, G_IO_IN, -1, receive_data,
- session_device_id);
+ sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data,
+ session_device_id);
/* Send header packet to the session bus. */
packet = g_malloc(sizeof(struct sr_datafeed_packet));
lupfd = libusb_get_pollfds(usb_context);
for (i = 0; lupfd[i]; i++)
- source_add(lupfd[i]->fd, lupfd[i]->events, 40, receive_data,
- NULL);
+ sr_source_add(lupfd[i]->fd, lupfd[i]->events, 40, receive_data,
+ NULL);
free(lupfd);
packet->type = SR_DF_HEADER;
/* unnecessary level of indirection follows. */
-void source_remove(int fd)
+void sr_source_remove(int fd)
{
sr_session_source_remove(fd);
}
-void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb,
- void *user_data)
+void sr_source_add(int fd, int events, int timeout,
+ receive_data_callback rcv_cb, void *user_data)
{
sr_session_source_add(fd, events, timeout, rcv_cb, user_data);
}
int sr_find_hwcap(int *capabilities, int hwcap);
struct sr_hwcap_option *sr_find_hwcap_option(int hwcap);
-void source_remove(int fd);
-void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb,
- void *user_data);
+void sr_source_remove(int fd);
+void sr_source_add(int fd, int events, int timeout,
+ receive_data_callback rcv_cb, void *user_data);
/*--- session.c -------------------------------------------------------------*/