![]() |
libsigrokdecode
0.2.0
sigrok protocol decoding library
|
Decoder instance handling. More...
Functions | |
int | srd_inst_option_set (struct srd_decoder_inst *di, GHashTable *options) |
Set one or more options in a decoder instance. More... | |
int | srd_inst_probe_set_all (struct srd_decoder_inst *di, GHashTable *new_probes) |
Set all probes in a decoder instance. More... | |
struct srd_decoder_inst * | srd_inst_new (const char *decoder_id, GHashTable *options) |
Create a new protocol decoder instance. More... | |
int | srd_inst_stack (struct srd_decoder_inst *di_from, struct srd_decoder_inst *di_to) |
Stack a decoder instance on top of another. More... | |
struct srd_decoder_inst * | srd_inst_find_by_id (const char *inst_id) |
Find a decoder instance by its instance ID. More... | |
Decoder instance handling.
|
read |
Find a decoder instance by its instance ID.
Only the bottom level of instances are searched – instances already stacked on top of another one will not be found.
inst_id | The instance ID to be found. |
Definition at line 641 of file controller.c.
References srd_decoder_inst::inst_id.
|
read |
Create a new protocol decoder instance.
decoder_id | Decoder 'id' field. |
options | GHashtable of options which override the defaults set in the decoder class. May be NULL. |
Definition at line 533 of file controller.c.
References srd_decoder_inst::dec_num_probes, srd_decoder_inst::dec_probemap, srd_decoder_inst::decoder, srd_decoder_inst::inst_id, srd_decoder::opt_probes, srd_decoder::probes, srd_decoder::py_dec, srd_decoder_inst::py_inst, srd_decoder_get_by_id(), srd_inst_option_set(), and SRD_OK.
int srd_inst_option_set | ( | struct srd_decoder_inst * | di, |
GHashTable * | options | ||
) |
Set one or more options in a decoder instance.
Handled options are removed from the hash.
di | Decoder instance. |
options | A GHashTable of options to set. |
Definition at line 296 of file controller.c.
References srd_decoder_inst::decoder, srd_decoder::py_dec, srd_decoder_inst::py_inst, SRD_ERR_ARG, SRD_ERR_PYTHON, and SRD_OK.
Referenced by srd_inst_new().
int srd_inst_probe_set_all | ( | struct srd_decoder_inst * | di, |
GHashTable * | new_probes | ||
) |
Set all probes in a decoder instance.
This function sets all probes for the specified decoder instance, i.e., it overwrites any probes that were already defined (if any).
di | Decoder instance. |
new_probes | A GHashTable of probes to set. Key is probe name, value is the probe number. Samples passed to this instance will be arranged in this order. |
Definition at line 441 of file controller.c.
References srd_decoder_inst::dec_num_probes, srd_decoder_inst::dec_probemap, srd_decoder_inst::decoder, srd_probe::id, srd_decoder_inst::inst_id, srd_decoder::name, srd_decoder::opt_probes, srd_probe::order, srd_decoder::probes, SRD_ERR_ARG, SRD_ERR_MALLOC, and SRD_OK.
int srd_inst_stack | ( | struct srd_decoder_inst * | di_from, |
struct srd_decoder_inst * | di_to | ||
) |
Stack a decoder instance on top of another.
di_from | The instance to move. |
di_to | The instance on top of which di_from will be stacked. |
Definition at line 610 of file controller.c.
References srd_decoder_inst::next_di, SRD_ERR_ARG, and SRD_OK.