22 #ifndef LIBSIGROKDECODE_LIBSIGROKDECODE_H
23 #define LIBSIGROKDECODE_LIBSIGROKDECODE_H
110 #define SRD_API __attribute__((visibility("default")))
117 #define SRD_PRIV __attribute__((visibility("hidden")))
279 uint64_t start_samplenum, uint64_t end_samplenum,
280 const uint8_t *inbuf, uint64_t inbuflen, uint64_t unitsize);
300 const char *
id, GHashTable *options);
308 const char *format, va_list args);
char * license
The license of the decoder.
uint8_t * channel_samples
char * srd_decoder_doc_get(const struct srd_decoder *dec)
Return a protocol decoder's docstring.
GSList * opt_channels
List of optional channels for this decoder.
struct srd_decoder_inst * srd_inst_new(struct srd_session *sess, const char *id, GHashTable *options)
Create a new protocol decoder instance.
const GSList * srd_decoder_list(void)
Returns the list of loaded protocol decoders.
int srd_session_send(struct srd_session *sess, uint64_t start_samplenum, uint64_t end_samplenum, const uint8_t *inbuf, uint64_t inbuflen, uint64_t unitsize)
Send a chunk of logic sample data to a running decoder session.
Structure which contains information about one protocol decoder channel.
struct srd_decoder * srd_decoder_get_by_id(const char *id)
Get the decoder with the specified ID.
const char * srd_strerror(int error_code)
Return a human-readable error string for the given libsigrokdecode error code.
int srd_inst_option_set(struct srd_decoder_inst *di, GHashTable *options)
Set one or more options in a decoder instance.
struct srd_pd_output * pdo
int srd_package_version_micro_get(void)
Get the micro libsigrokdecode package version number.
int srd_session_destroy(struct srd_session *sess)
Destroy a decoding session.
struct srd_decoder_inst * di
const char * srd_strerror_name(int error_code)
Return the "name" string of the given libsigrokdecode error code.
char * name
The (short) decoder name.
char * longname
The (long) decoder name.
int order
The index of the channel, i.e.
char * id
The ID of the channel.
Protocol decoder path invalid.
int srd_log_loglevel_get(void)
Get the libsigrokdecode loglevel.
char * name
The name of the channel.
int srd_session_new(struct srd_session **sess)
Create a decoding session.
GSList * annotations
List of NULL-terminated char[], containing descriptions of the supported annotation output...
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.
const char * srd_package_version_string_get(void)
Get the libsigrokdecode package version number as a string.
int srd_lib_version_age_get(void)
Get the "age" part of the libsigrokdecode library version number.
char * desc
A (short, one-line) description of the decoder.
int srd_lib_version_current_get(void)
Get the "current" part of the libsigrokdecode library version number.
int srd_decoder_unload_all(void)
Unload all loaded protocol decoders.
int srd_decoder_load(const char *name)
Load a protocol decoder module into the embedded Python interpreter.
srd_pd_output_callback cb
Malloc/calloc/realloc error.
int srd_decoder_unload(struct srd_decoder *dec)
Unload the specified protocol decoder.
int srd_log_callback_set_default(void)
Set the libsigrokdecode log callback to the default built-in one.
Output no messages at all.
int srd_log_loglevel_set(int loglevel)
Set the libsigrokdecode loglevel.
int srd_exit(void)
Shutdown libsigrokdecode.
int srd_init(const char *path)
Initialize libsigrokdecode.
GSList * binary
List of NULL-terminated char[], containing descriptions of the supported binary output.
Output very noisy debug messages.
const unsigned char * data
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.
Output informational messages.
void(* srd_pd_output_callback)(struct srd_proto_data *pdata, void *cb_data)
int srd_inst_channel_set_all(struct srd_decoder_inst *di, GHashTable *channels)
Set all channels in a decoder instance.
GSList * options
List of decoder options.
const char * srd_lib_version_string_get(void)
Get the libsigrokdecode library version number as a string.
char * desc
The description of the channel.
void * py_mod
Python module.
int srd_package_version_major_get(void)
Get the major libsigrokdecode package version number.
GSList * annotation_rows
List of annotation rows (row items: id, description, and a list of annotation classes belonging to th...
void * py_dec
sigrokdecode.Decoder class.
const GVariantType * meta_type
int srd_log_callback_set(srd_log_callback cb, void *cb_data)
Set the libsigrokdecode log callback to the specified function.
struct srd_decoder * decoder
int srd_session_metadata_set(struct srd_session *sess, int key, GVariant *data)
Set a metadata configuration key in a session.
int srd_session_start(struct srd_session *sess)
Start a decoding session.
Errors hinting at internal bugs.
int(* srd_log_callback)(void *cb_data, int loglevel, const char *format, va_list args)
int srd_package_version_minor_get(void)
Get the minor libsigrokdecode package version number.
srd_error_code
Status/error codes returned by libsigrokdecode functions.
GSList * channels
List of channels required by this decoder.
int srd_lib_version_revision_get(void)
Get the "revision" part of the libsigrokdecode library version number.
Generic/unspecified error.
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.
struct srd_session * sess
Version number definitions and macros.
int srd_decoder_load_all(void)
Load all installed protocol decoders.