![]() |
libsigrok
0.2.0
sigrok hardware access and backend library
|
Creating, using, or destroying libsigrok sessions. More...
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
#include "libsigrok.h"
#include "libsigrok-internal.h"
Go to the source code of this file.
Macros | |
#define | LOG_PREFIX "session: " |
#define | sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) |
#define | sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) |
#define | sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) |
#define | sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) |
#define | sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) |
#define | sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) |
Functions | |
struct sr_session * | sr_session_new (void) |
Create a new session. More... | |
int | sr_session_destroy (void) |
Destroy the current session. More... | |
int | sr_session_dev_remove_all (void) |
Remove all the devices from the current session. More... | |
int | sr_session_dev_add (const struct sr_dev_inst *sdi) |
Add a device instance to the current session. More... | |
int | sr_session_datafeed_callback_remove_all (void) |
Remove all datafeed callbacks in the current session. More... | |
int | sr_session_datafeed_callback_add (sr_datafeed_callback_t cb, void *cb_data) |
Add a datafeed callback to the current session. More... | |
int | sr_session_start (void) |
Start a session. More... | |
int | sr_session_run (void) |
Run the session. More... | |
SR_PRIV int | sr_session_stop_sync (void) |
Stop the current session. More... | |
int | sr_session_stop (void) |
Stop the current session. More... | |
int | sr_session_source_add (int fd, int events, int timeout, sr_receive_data_callback_t cb, void *cb_data) |
Add an event source for a file descriptor. More... | |
int | sr_session_source_add_pollfd (GPollFD *pollfd, int timeout, sr_receive_data_callback_t cb, void *cb_data) |
Add an event source for a GPollFD. More... | |
int | sr_session_source_add_channel (GIOChannel *channel, int events, int timeout, sr_receive_data_callback_t cb, void *cb_data) |
Add an event source for a GIOChannel. More... | |
int | sr_session_source_remove (int fd) |
Remove the source belonging to the specified file descriptor. More... | |
int | sr_session_source_remove_pollfd (GPollFD *pollfd) |
Remove the source belonging to the specified poll descriptor. More... | |
int | sr_session_source_remove_channel (GIOChannel *channel) |
Remove the source belonging to the specified channel. More... | |
Variables | |
struct sr_session * | session |
Creating, using, or destroying libsigrok sessions.
Definition in file session.c.
#define sr_dbg | ( | s, | |
args... | |||
) | sr_dbg(LOG_PREFIX s, ## args) |
Definition at line 32 of file session.c.
Referenced by sr_session_dev_add().
#define sr_err | ( | s, | |
args... | |||
) | sr_err(LOG_PREFIX s, ## args) |
Definition at line 35 of file session.c.
Referenced by sr_session_datafeed_callback_add(), sr_session_datafeed_callback_remove_all(), sr_session_destroy(), sr_session_dev_add(), sr_session_dev_remove_all(), sr_session_new(), sr_session_run(), sr_session_start(), sr_session_stop(), and sr_session_stop_sync().
#define sr_info | ( | s, | |
args... | |||
) | sr_info(LOG_PREFIX s, ## args) |
Definition at line 33 of file session.c.
Referenced by sr_session_run(), sr_session_start(), and sr_session_stop_sync().
#define sr_log | ( | l, | |
s, | |||
args... | |||
) | sr_log(l, LOG_PREFIX s, ## args) |
#define sr_spew | ( | s, | |
args... | |||
) | sr_spew(LOG_PREFIX s, ## args) |
#define sr_warn | ( | s, | |
args... | |||
) | sr_warn(LOG_PREFIX s, ## args) |