21 #ifndef LIBSIGROKDECODE_LIBSIGROKDECODE_H 22 #define LIBSIGROKDECODE_LIBSIGROKDECODE_H 110 # if defined DLL_EXPORT 111 # define SRD_API __declspec(dllexport) 113 # define SRD_API extern 116 # define SRD_API __attribute__((visibility("default"))) 123 # define SRD_PRIV __attribute__((visibility("hidden"))) 361 uint64_t abs_start_samplenum, uint64_t abs_end_samplenum,
362 const uint8_t *inbuf, uint64_t inbuflen, uint64_t unitsize);
384 const char *
id, GHashTable *
options);
390 GArray *initial_pins);
394 const char *format, va_list args);
Errors hinting at internal bugs.
GSList * binary
List of binary classes.
GSList * srd_searchpaths_get(void)
Return the list of protocol decoder search paths.
uint64_t inbuflen
Length (in bytes) of the input sample buffer.
Output very noisy debug messages.
gboolean communicate_eof
Requests that .wait() terminates a Python iteration.
char * longname
The (long) decoder name.
char * srd_buildinfo_host_get(void)
void(* srd_pd_output_callback)(struct srd_proto_data *pdata, void *cb_data)
int srd_decoder_unload_all(void)
Unload all loaded protocol decoders.
int srd_session_start(struct srd_session *sess)
Start a decoding session.
GCond got_new_samples_cond
GThread * thread_handle
Handle for this PD stack's worker thread.
const char * srd_package_version_string_get(void)
Get the libsigrokdecode package version number as a string.
GSList * options
List of decoder options.
GSList * channels
List of channels required by this decoder.
Generic/unspecified error.
char * desc
A (short, one-line) description of the decoder.
const char * srd_strerror(int error_code)
Return a human-readable error string for the given libsigrokdecode error code.
GSList * logic_output_channels
List of logic output channels (item: id, description).
uint64_t abs_start_samplenum
Absolute start sample number.
int srd_log_callback_set_default(void)
Set the libsigrokdecode log callback to the default built-in one.
const char * srd_strerror_name(int error_code)
Return the "name" string of the given libsigrokdecode error code.
int(* srd_log_callback)(void *cb_data, int loglevel, const char *format, va_list args)
int srd_exit(void)
Shutdown libsigrokdecode.
int srd_lib_version_age_get(void)
Get the "age" part of the libsigrokdecode library version number.
void * py_mod
Python module.
Output informational messages.
int srd_lib_version_current_get(void)
Get the "current" part of the libsigrokdecode library version number.
int srd_decoder_load(const char *name)
Load a protocol decoder module into the embedded Python interpreter.
int srd_session_send(struct srd_session *sess, uint64_t abs_start_samplenum, uint64_t abs_end_samplenum, const uint8_t *inbuf, uint64_t inbuflen, uint64_t unitsize)
Send a chunk of logic sample data to a running decoder session.
int srd_log_callback_get(srd_log_callback *cb, void **cb_data)
Get the libsigrokdecode log callback routine and callback data.
struct srd_pd_output * pdo
int srd_log_loglevel_set(int loglevel)
Set the libsigrokdecode loglevel.
int srd_inst_stack(struct srd_session *sess, struct srd_decoder_inst *di_from, struct srd_decoder_inst *di_to)
Stack a decoder instance on top of another.
int srd_session_destroy(struct srd_session *sess)
Destroy a decoding session.
int srd_inst_initial_pins_set_all(struct srd_decoder_inst *di, GArray *initial_pins)
Set the list of initial (assumed) pin values.
GSList * annotation_rows
List of annotation rows (row items: id, description, and a list of annotation classes belonging to th...
Malloc/calloc/realloc error.
Output no messages at all.
int srd_session_send_eof(struct srd_session *sess)
Communicate the end of the stream of sample data to the session.
int srd_decoder_load_all(void)
Load all installed protocol decoders.
GSList * tags
List of tags associated with this decoder.
GCond handled_all_samples_cond
struct srd_decoder_inst * srd_inst_new(struct srd_session *sess, const char *id, GHashTable *options)
Create a new protocol decoder instance.
GSList * annotations
List of annotation classes.
int srd_session_new(struct srd_session **sess)
Create a decoding session.
int srd_init(const char *path)
Initialize libsigrokdecode.
int order
The index of the channel, i.e.
uint64_t abs_cur_samplenum
Absolute current samplenumber.
const uint8_t * inbuf
Pointer to the buffer/chunk of input samples.
void * py_dec
sigrokdecode.Decoder class.
int srd_package_version_major_get(void)
Get the major libsigrokdecode package version number.
int srd_lib_version_revision_get(void)
Get the "revision" part of the libsigrokdecode library version number.
gboolean got_new_samples
Indicates whether new samples are available for processing.
char * name
The name of the channel.
GArray * match_array
Array of booleans denoting which conditions matched.
struct srd_decoder_inst * di
int srd_log_callback_set(srd_log_callback cb, void *cb_data)
Set the libsigrokdecode log callback to the specified function.
int srd_package_version_micro_get(void)
Get the micro libsigrokdecode package version number.
char * id
The ID of the channel.
struct srd_decoder * srd_decoder_get_by_id(const char *id)
Get the decoder with the specified ID.
gboolean handled_all_samples
Indicates whether the worker thread has handled all samples.
char * desc
The description of the channel.
int srd_pd_output_callback_add(struct srd_session *sess, int output_type, srd_pd_output_callback cb, void *cb_data)
Register/add a decoder output callback function.
uint8_t * channel_samples
int srd_inst_option_set(struct srd_decoder_inst *di, GHashTable *options)
Set one or more options in a decoder instance.
Protocol decoder path invalid.
const GSList * srd_decoder_list(void)
Returns the list of loaded protocol decoders.
struct srd_decoder * decoder
int srd_inst_channel_set_all(struct srd_decoder_inst *di, GHashTable *channels)
Set all channels in a decoder instance.
const char * srd_lib_version_string_get(void)
Get the libsigrokdecode library version number as a string.
GArray * old_pins_array
Array of "old" (previous sample) pin values.
GSList * srd_buildinfo_libs_get(void)
uint64_t abs_end_samplenum
Absolute end sample number.
struct srd_session * sess
GSList * condition_list
List of conditions a PD wants to wait for.
GSList * opt_channels
List of optional channels for this decoder.
GSList * inputs
List of possible decoder input IDs.
GSList * outputs
List of possible decoder output IDs.
int srd_log_loglevel_get(void)
Get the libsigrokdecode loglevel.
int srd_package_version_minor_get(void)
Get the minor libsigrokdecode package version number.
gboolean want_wait_terminate
Requests termination of wait() and decode().
srd_pd_output_callback cb
int srd_session_metadata_set(struct srd_session *sess, int key, GVariant *data)
Set a metadata configuration key in a session.
const GVariantType * meta_type
int srd_decoder_unload(struct srd_decoder *dec)
Unload the specified protocol decoder.
char * license
The license of the decoder.
Structure which contains information about one protocol decoder channel.
char * srd_decoder_doc_get(const struct srd_decoder *dec)
Return a protocol decoder's docstring.
int decoder_state
Indicates the current state of the decoder stack.
int srd_session_terminate_reset(struct srd_session *sess)
Terminate currently executing decoders in a session, reset internal state.
srd_error_code
Status/error codes returned by libsigrokdecode functions.
struct srd_decoder_inst * srd_inst_find_by_id(struct srd_session *sess, const char *inst_id)
Find a decoder instance by its instance ID.
char * name
The (short) decoder name.