libsigrokdecode
0.4.0
sigrok protocol decoding library
|
Initializing and shutting down libsigrokdecode. More...
Functions | |
int | srd_init (const char *path) |
Initialize libsigrokdecode. More... | |
int | srd_exit (void) |
Shutdown libsigrokdecode. More... | |
Initializing and shutting down libsigrokdecode.
Before using any of the libsigrokdecode functionality, srd_init() must be called to initialize the library.
When libsigrokdecode functionality is no longer needed, srd_exit() should be called.
int srd_exit | ( | void | ) |
Shutdown libsigrokdecode.
This frees all the memory allocated for protocol decoders and shuts down the Python interpreter.
This function should only be called if there was a (successful!) invocation of srd_init() before. Calling this function multiple times in a row, without any successful srd_init() calls in between, is not allowed.
Definition at line 220 of file srd.c.
References srd_decoder_unload_all(), SRD_OK, and srd_session_destroy().
int srd_init | ( | const char * | path | ) |
Initialize libsigrokdecode.
This initializes the Python interpreter, and creates and initializes a "sigrokdecode" Python module.
Then, it searches for sigrok protocol decoders in the "decoders" subdirectory of the the libsigrokdecode installation directory. All decoders that are found are loaded into memory and added to an internal list of decoders, which can be queried via srd_decoder_list().
The caller is responsible for calling the clean-up function srd_exit(), which will properly shut down libsigrokdecode and free its allocated memory.
Multiple calls to srd_init(), without calling srd_exit() in between, are not allowed.
path | Path to an extra directory containing protocol decoders which will be added to the Python sys.path. May be NULL. |