libsigrokdecode  0.2.0
sigrok protocol decoding library
 All Data Structures Files Functions Variables Typedefs Enumerator Macros Groups Pages
Functions
Protocol decoders

Handling protocol decoders. More...

Functions

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

Detailed Description

Handling protocol decoders.

Function Documentation

char* srd_decoder_doc_get ( const struct srd_decoder dec)

Return a protocol decoder's docstring.

Parameters
decThe loaded protocol decoder.
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 411 of file decoder.c.

References srd_decoder::py_mod.

struct srd_decoder* srd_decoder_get_by_id ( const char *  id)
read

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 73 of file decoder.c.

References srd_decoder::id.

Referenced by srd_inst_new().

+ Here is the caller graph for this function:

const GSList* srd_decoder_list ( void  )

Returns the list of supported/loaded protocol decoders.

This is a GSList containing the names of the decoders as strings.

Returns
List of decoders, NULL if none are supported or loaded.
Since
0.1.0 (but the API changed in 0.2.0)

Definition at line 59 of file decoder.c.

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 242 of file decoder.c.

References srd_decoder::annotations, srd_decoder::desc, srd_decoder::id, srd_decoder::license, srd_decoder::longname, srd_decoder::name, srd_decoder::opt_probes, srd_probe::order, srd_decoder::probes, srd_decoder::py_dec, srd_decoder::py_mod, SRD_ERR_MALLOC, SRD_ERR_PYTHON, and SRD_OK.

Referenced by srd_decoder_load_all().

+ Here is the caller graph for this function:

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 508 of file decoder.c.

References srd_decoder_load(), SRD_ERR_DECODERS_DIR, and SRD_OK.

+ Here is the call graph for this function:

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 459 of file decoder.c.

References srd_decoder_option::def, srd_decoder::desc, srd_decoder_option::desc, srd_decoder::id, srd_decoder_option::id, srd_decoder::license, srd_decoder::longname, srd_decoder::name, srd_decoder::opt_probes, srd_decoder::options, srd_decoder::probes, srd_decoder::py_dec, srd_decoder::py_mod, and SRD_OK.

Referenced by srd_decoder_unload_all().

+ Here is the caller graph for this function:

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 535 of file decoder.c.

References srd_decoder_unload(), and SRD_OK.

Referenced by srd_exit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: