20 #ifndef LIBSIGROK_SIGROK_PROTO_H
21 #define LIBSIGROK_SIGROK_PROTO_H
37 const char *format, va_list args);
49 int probenum,
const char *name);
63 const GArray *probe_array,
const uint8_t *data_in,
64 uint64_t length_in, uint8_t **data_out,
65 uint64_t *length_out);
104 unsigned char *buf,
int unitsize,
int units);
130 const char *triggerstring);
struct sr_output_format ** sr_output_list(void)
int sr_dev_probe_name_set(const struct sr_dev_inst *sdi, int probenum, const char *name)
Set the name of the specified probe in the specified device.
int sr_package_version_major_get(void)
Get the major libsigrok package version number.
int sr_log_callback_set(sr_log_callback_t cb, void *cb_data)
Set the libsigrok log callback to the specified function.
int sr_parse_voltage(const char *voltstr, uint64_t *p, uint64_t *q)
int sr_filter_probes(unsigned int in_unitsize, unsigned int out_unitsize, const GArray *probe_array, const uint8_t *data_in, uint64_t length_in, uint8_t **data_out, uint64_t *length_out)
Remove unused probes from samples.
int sr_session_destroy(void)
Destroy the current session.
char * sr_voltage_string(uint64_t v_p, uint64_t v_q)
Convert a numeric voltage value to the "natural" string representation of its voltage value...
int sr_parse_sizestring(const char *sizestring, uint64_t *size)
Convert a "natural" string representation of a size value to uint64_t.
int sr_package_version_minor_get(void)
Get the minor libsigrok package version number.
int sr_session_save(const char *filename, const struct sr_dev_inst *sdi, unsigned char *buf, int unitsize, int units)
Save the current session to the specified file.
int sr_exit(struct sr_context *ctx)
Shutdown libsigrok.
char * sr_log_logdomain_get(void)
Get the currently configured libsigrok logdomain.
int sr_session_source_remove(int fd)
Remove the source belonging to the specified file descriptor.
const char * sr_strerror_name(int error_code)
Return the "name" string of the given libsigrok error code.
char * sr_si_string_u64(uint64_t x, const char *unit)
Convert a numeric value value to its "natural" string representation in SI units. ...
int sr_log_loglevel_set(int loglevel)
Set the libsigrok loglevel.
GSList * sr_dev_list(const struct sr_dev_driver *driver)
Get the list of devices/instances of the specified driver.
int sr_package_version_micro_get(void)
Get the micro libsigrok package version number.
int sr_parse_period(const char *periodstr, uint64_t *p, uint64_t *q)
char * sr_samplerate_string(uint64_t samplerate)
Convert a numeric samplerate value to its "natural" string representation.
int sr_log_loglevel_get(void)
Get the libsigrok loglevel.
const char * sr_package_version_string_get(void)
Get the libsigrok package version number as a string.
int sr_session_dev_remove_all(void)
Remove all the devices from the current session.
struct sr_config_info * sr_config_info_get(int key)
Get information about a configuration key.
uint64_t sr_parse_timestring(const char *timestring)
Convert a "natural" string representation of a time value to an uint64_t value in milliseconds...
int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum, gboolean state)
Enable or disable a probe on the specified device.
int sr_session_stop(void)
Stop the current session.
void(* sr_datafeed_callback_t)(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, void *cb_data)
gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key)
Determine whether the specified device instance has the specified capability.
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.
int sr_session_load(const char *filename)
Load the session from the specified filename.
struct sr_input_format ** sr_input_list(void)
int(* sr_log_callback_t)(void *cb_data, int loglevel, const char *format, va_list args)
int sr_lib_version_revision_get(void)
Get the "revision" part of the libsigrok library version number.
int sr_session_source_remove_channel(GIOChannel *channel)
Remove the source belonging to the specified channel.
char * sr_period_string(uint64_t frequency)
Convert a numeric frequency value to the "natural" string representation of its period.
int sr_log_callback_set_default(void)
Set the libsigrok log callback to the default built-in one.
int sr_session_datafeed_callback_add(sr_datafeed_callback_t cb, void *cb_data)
Add a datafeed callback to the current session.
GSList * sr_driver_scan(struct sr_dev_driver *driver, GSList *options)
Tell a hardware driver to scan for devices.
int sr_lib_version_current_get(void)
Get the "current" part of the libsigrok library version number.
int sr_session_datafeed_callback_remove_all(void)
Remove all datafeed callbacks in the current session.
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.
struct sr_config_info * sr_config_info_name_get(const char *optname)
Get information about an configuration key, by name.
int(* sr_receive_data_callback_t)(int fd, int revents, void *cb_data)
int sr_dev_open(struct sr_dev_inst *sdi)
Open the specified device.
int sr_config_set(const struct sr_dev_inst *sdi, int key, GVariant *data)
Set a configuration key in a device instance.
int sr_driver_init(struct sr_context *ctx, struct sr_dev_driver *driver)
Initialize a hardware driver.
int sr_dev_close(struct sr_dev_inst *sdi)
Close the specified device.
int sr_session_run(void)
Run the session.
const char * sr_lib_version_string_get(void)
Get the libsigrok library version number as a string.
struct sr_session * sr_session_new(void)
Create a new session.
struct sr_dev_driver ** sr_driver_list(void)
Return the list of supported hardware drivers.
int sr_dev_clear(const struct sr_dev_driver *driver)
Clear all devices/instances of the specified driver.
int sr_session_source_remove_pollfd(GPollFD *pollfd)
Remove the source belonging to the specified poll descriptor.
int sr_session_dev_add(const struct sr_dev_inst *sdi)
Add a device instance to the current session.
int sr_session_start(void)
Start a session.
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.
char ** sr_parse_triggerstring(const struct sr_dev_inst *sdi, const char *triggerstring)
Parse a trigger specification string.
const char * sr_strerror(int error_code)
Return a human-readable error string for the given libsigrok error code.
gboolean sr_parse_boolstring(const char *boolstring)
int sr_lib_version_age_get(void)
Get the "age" part of the libsigrok library version number.
int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum, const char *trigger)
Add a trigger to the specified device (and the specified probe).
int sr_init(struct sr_context **ctx)
Initialize libsigrok.
int sr_config_get(const struct sr_dev_driver *driver, int key, GVariant **data, const struct sr_dev_inst *sdi)
Returns information about the given driver or device instance.
int sr_config_list(const struct sr_dev_driver *driver, int key, GVariant **data, const struct sr_dev_inst *sdi)
List all possible values for a configuration key.
int sr_log_logdomain_set(const char *logdomain)
Set the libsigrok logdomain string.