libsigrokdecode 0.5.3
sigrok protocol decoding library
Loading...
Searching...
No Matches
Functions
Protocol decoders

Functions

const GSList * srd_decoder_list (void)
 Returns the list of loaded protocol decoders.
 
struct srd_decodersrd_decoder_get_by_id (const char *id)
 Get the decoder with the specified ID.
 
int srd_decoder_load (const char *module_name)
 Load a protocol decoder module into the embedded Python interpreter.
 
char * srd_decoder_doc_get (const struct srd_decoder *dec)
 Return a protocol decoder's docstring.
 
int srd_decoder_unload (struct srd_decoder *dec)
 Unload the specified protocol decoder.
 
int srd_decoder_load_all (void)
 Load all installed protocol decoders.
 
int srd_decoder_unload_all (void)
 Unload all loaded protocol decoders.
 

Detailed Description

Handling protocol decoders.

Function Documentation

◆ srd_decoder_doc_get()

char * srd_decoder_doc_get ( const struct srd_decoder * dec)

Return a protocol decoder's docstring.

Parameters
decThe loaded protocol decoder. Must not be NULL.
Returns
A newly allocated buffer containing the protocol decoder's documentation. The caller is responsible for free'ing the buffer.
Since
0.1.0

Definition at line 873 of file decoder.c.

References srd_decoder::py_mod.

◆ srd_decoder_get_by_id()

struct srd_decoder * srd_decoder_get_by_id ( const char * id)

Get the decoder with the specified ID.

Parameters
idThe ID string of the decoder to return.
Returns
The decoder with the specified ID, or NULL if not found.
Since
0.1.0

Definition at line 89 of file decoder.c.

References srd_decoder::id.

Referenced by srd_inst_new().

+ Here is the caller graph for this function:

◆ srd_decoder_list()

const GSList * srd_decoder_list ( void )

Returns the list of loaded protocol decoders.

This is a GSList of pointers to struct srd_decoder items.

Returns
List of decoders, NULL if none are supported or loaded.
Since
0.2.0

Definition at line 75 of file decoder.c.

◆ srd_decoder_load()

int srd_decoder_load ( const char * module_name)

Load a protocol decoder module into the embedded Python interpreter.

Parameters
module_nameThe module name to be loaded.
Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 679 of file decoder.c.

References srd_decoder::channels, srd_decoder::desc, srd_decoder::id, srd_decoder::inputs, srd_decoder::license, srd_decoder::longname, srd_decoder::name, srd_decoder::opt_channels, srd_decoder::outputs, srd_decoder::py_dec, srd_decoder::py_mod, SRD_ERR, SRD_ERR_ARG, SRD_ERR_PYTHON, and SRD_OK.

◆ srd_decoder_load_all()

int srd_decoder_load_all ( void )

Load all installed protocol decoders.

Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 1063 of file decoder.c.

References SRD_ERR, and SRD_OK.

◆ srd_decoder_unload()

int srd_decoder_unload ( struct srd_decoder * dec)

Unload the specified protocol decoder.

Parameters
decThe struct srd_decoder to be unloaded.
Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 919 of file decoder.c.

References SRD_ERR, SRD_ERR_ARG, and SRD_OK.

◆ srd_decoder_unload_all()

int srd_decoder_unload_all ( void )

Unload all loaded protocol decoders.

Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 1090 of file decoder.c.

References SRD_OK.

Referenced by srd_exit().

+ Here is the caller graph for this function: