MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / sr_session_source_add

Function sr_session_source_add

libsigrok4DSL/session.c:396–405  ·  view source on GitHub ↗

* Add an event source for a file descriptor. * * @param fd The file descriptor. * @param events Events to check for. * @param timeout Max time to wait before the callback is called, ignored if 0. * @param cb Callback function to add. Must not be NULL. * @param cb_data Data for the callback function. Can be NULL. * * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or *

Source from the content-addressed store, hash-verified

394 * SR_ERR_MALLOC upon memory allocation errors.
395 */
396SR_PRIV int sr_session_source_add(int fd, int events, int timeout,
397 sr_receive_data_callback_t cb, const struct sr_dev_inst *sdi)
398{
399 GPollFD p;
400
401 p.fd = fd;
402 p.events = events;
403
404 return _sr_session_source_add(&p, timeout, cb, sdi, (gintptr)fd);
405}
406
407/**
408 * Add an event source for a GPollFD.

Callers 3

sr_source_addFunction · 0.85
dev_acquisition_startFunction · 0.85
hw_dev_acquisition_startFunction · 0.85

Calls 1

_sr_session_source_addFunction · 0.85

Tested by

no test coverage detected