20 #ifndef LIBSIGROK_PROTO_H
21 #define LIBSIGROK_PROTO_H
37 const char *
format, va_list args);
49 int channelnum,
const char *name);
69 int key, GVariant **data);
72 int key, GVariant *data);
77 int key, GVariant **data);
104 unsigned char *buf,
int unitsize,
int units);
108 int unitsize,
int units);
139 const char *triggerstring);
int sr_dev_channel_name_set(const struct sr_dev_inst *sdi, int channelnum, const char *name)
Set the name of the specified channel in the specified device.
Packet in a sigrok data feed.
struct sr_input_format ** sr_input_list(void)
GSList * sr_driver_scan(struct sr_dev_driver *driver, GSList *options)
Tell a hardware driver to scan for devices.
const struct sr_dev_inst * sdi
The device for which this output module is creating output.
int sr_output_free(struct sr_output *o)
Output (file) format struct.
int sr_lib_version_revision_get(void)
Get the "revision" part of the libsigrok library version number.
int sr_session_dev_add(const struct sr_dev_inst *sdi)
Add a device instance to the current session.
int sr_driver_init(struct sr_context *ctx, struct sr_dev_driver *driver)
Initialize a hardware driver.
int sr_exit(struct sr_context *ctx)
Shutdown libsigrok.
const char * sr_strerror_name(int error_code)
Return the "name" string of the given libsigrok error code.
char ** sr_parse_triggerstring(const struct sr_dev_inst *sdi, const char *triggerstring)
Parse a trigger specification string.
GSList * sr_dev_list(const struct sr_dev_driver *driver)
Get the list of devices/instances of the specified driver.
int sr_session_stop(void)
Stop the current session.
gboolean sr_parse_boolstring(const char *boolstring)
const struct sr_config_info * sr_config_info_get(int key)
Get information about a configuration key, by key.
int sr_session_start(void)
Start a session.
int sr_session_destroy(void)
Destroy the current session.
struct sr_output_format * format
A pointer to this output's format.
char * sr_period_string(uint64_t frequency)
Convert a numeric frequency value to the "natural" string representation of its period.
int sr_session_run(void)
Run the session.
const char * sr_package_version_string_get(void)
Get the libsigrok package version number as a string.
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_lib_version_current_get(void)
Get the "current" part of the libsigrok library version number.
struct sr_dev_driver ** sr_driver_list(void)
Return the list of supported hardware drivers.
int sr_session_append(const char *filename, unsigned char *buf, int unitsize, int units)
Append data to an existing session file.
int sr_package_version_minor_get(void)
Get the minor libsigrok package version number.
int sr_config_commit(const struct sr_dev_inst *sdi)
Apply configuration settings to the device hardware.
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_datafeed_callback_add(sr_datafeed_callback cb, void *cb_data)
Add a datafeed callback to the current session.
int sr_package_version_micro_get(void)
Get the micro libsigrok package version number.
int sr_log_loglevel_set(int loglevel)
Set the libsigrok loglevel.
Input (file) format driver.
const char * sr_lib_version_string_get(void)
Get the libsigrok library version number as a string.
int sr_session_source_add_pollfd(GPollFD *pollfd, int timeout, sr_receive_data_callback cb, void *cb_data)
Add an event source for a GPollFD.
int sr_log_loglevel_get(void)
Get the libsigrok loglevel.
char * sr_log_logdomain_get(void)
Get the currently configured libsigrok logdomain.
char * sr_si_string_u64(uint64_t x, const char *unit)
Convert a numeric value value to its "natural" string representation in SI units. ...
Opaque data structure representing a libsigrok session.
int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int channelnum, gboolean state)
Enable or disable a channel on the specified device.
Opaque structure representing a libsigrok context.
int sr_config_get(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, int key, GVariant **data)
Query value of a configuration key at the given driver or device instance.
int(* sr_receive_data_callback)(int fd, int revents, void *cb_data)
Type definition for callback function for data reception.
int sr_session_source_add_channel(GIOChannel *channel, int events, int timeout, sr_receive_data_callback cb, void *cb_data)
Add an event source for a GIOChannel.
int sr_parse_period(const char *periodstr, uint64_t *p, uint64_t *q)
int sr_dev_open(struct sr_dev_inst *sdi)
Open the specified device.
int sr_session_save_init(const char *filename, uint64_t samplerate, char **channels)
Initialize a saved session file.
int sr_dev_close(struct sr_dev_inst *sdi)
Close the specified device.
int sr_session_source_remove_pollfd(GPollFD *pollfd)
Remove the source belonging to the specified poll descriptor.
void(* sr_datafeed_callback)(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, void *cb_data)
int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int channelnum, const char *trigger)
Add a trigger to the specified device (and the specified channel).
int sr_config_list(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, int key, GVariant **data)
List all possible values for a configuration key.
struct sr_output_format ** sr_output_list(void)
int key
Config key like SR_CONF_CONN, etc.
int sr_output_send(struct sr_output *o, const struct sr_datafeed_packet *packet, GString **out)
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_parse_voltage(const char *voltstr, uint64_t *p, uint64_t *q)
int sr_session_source_remove_channel(GIOChannel *channel)
Remove the source belonging to the specified channel.
const struct sr_config_info * sr_config_info_name_get(const char *optname)
Get information about a configuration key, by name.
int sr_log_logdomain_set(const char *logdomain)
Set the libsigrok logdomain string.
int sr_config_set(const struct sr_dev_inst *sdi, const struct sr_channel_group *cg, int key, GVariant *data)
Set value of a configuration key in a device instance.
int sr_dev_clear(const struct sr_dev_driver *driver)
Clear the list of device instances a driver knows about.
int sr_lib_version_age_get(void)
Get the "age" part of the libsigrok library version number.
int sr_session_source_remove(int fd)
Remove the source belonging to the specified file descriptor.
int sr_package_version_major_get(void)
Get the major libsigrok package version number.
const char * sr_strerror(int error_code)
Return a human-readable error string for the given libsigrok error code.
struct sr_session * sr_session_new(void)
Create a new session.
int sr_parse_sizestring(const char *sizestring, uint64_t *size)
Convert a "natural" string representation of a size value to uint64_t.
int sr_init(struct sr_context **ctx)
Initialize libsigrok.
int(* sr_log_callback)(void *cb_data, int loglevel, const char *format, va_list args)
char * sr_samplerate_string(uint64_t samplerate)
Convert a numeric samplerate value to its "natural" string representation.
int sr_log_callback_set_default(void)
Set the libsigrok log callback to the default built-in one.
Output (file) format driver.
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.
struct sr_output * sr_output_new(struct sr_output_format *of, GHashTable *params, const struct sr_dev_inst *sdi)
int sr_log_callback_set(sr_log_callback cb, void *cb_data)
Set the libsigrok log callback to the specified function.
Information about a config key.
int sr_session_datafeed_callback_remove_all(void)
Remove all datafeed callbacks in the current session.
int sr_session_dev_list(GSList **devlist)
List all device instances attached to the current session.
Structure for groups of channels that have common properties.
int sr_session_load(const char *filename)
Load the session from the specified filename.
int sr_session_source_add(int fd, int events, int timeout, sr_receive_data_callback cb, void *cb_data)
Add an event source for a file descriptor.
GHashTable * params
An optional parameter which the frontend can pass in to the output module.
int sr_session_dev_remove_all(void)
Remove all the devices from the current session.