![]() |
libsigrokdecode
0.2.0
sigrok protocol decoding library
|
Starting and handling decoding sessions. More...
Functions | |
int | srd_session_start (int num_probes, int unitsize, uint64_t samplerate) |
Start a decoding session. More... | |
int | srd_session_send (uint64_t start_samplenum, const uint8_t *inbuf, uint64_t inbuflen) |
Send a chunk of logic sample data to a running decoder session. More... | |
int | srd_pd_output_callback_add (int output_type, srd_pd_output_callback_t cb, void *cb_data) |
Register/add a decoder output callback function. More... | |
Starting and handling decoding sessions.
int srd_pd_output_callback_add | ( | int | output_type, |
srd_pd_output_callback_t | cb, | ||
void * | cb_data | ||
) |
Register/add a decoder output callback function.
The function will be called when a protocol decoder sends output back to the PD controller (except for Python objects, which only go up the stack).
output_type | The output type this callback will receive. Only one callback per output type can be registered. |
cb | The function to call. Must not be NULL. |
cb_data | Private data for the callback function. Can be NULL. |
Definition at line 943 of file controller.c.
References srd_pd_callback::cb, srd_pd_callback::cb_data, srd_pd_callback::output_type, SRD_ERR_MALLOC, and SRD_OK.
int srd_session_send | ( | uint64_t | start_samplenum, |
const uint8_t * | inbuf, | ||
uint64_t | inbuflen | ||
) |
Send a chunk of logic sample data to a running decoder session.
start_samplenum | The sample number of the first sample in this chunk. |
inbuf | Pointer to sample data. |
inbuflen | Length in bytes of the buffer. |
Definition at line 910 of file controller.c.
References SRD_OK.
int srd_session_start | ( | int | num_probes, |
int | unitsize, | ||
uint64_t | samplerate | ||
) |
Start a decoding session.
Decoders, instances and stack must have been prepared beforehand.
num_probes | The number of probes which the incoming feed will contain. |
unitsize | The number of bytes per sample in the incoming feed. |
samplerate | The samplerate of the incoming feed. |
Definition at line 863 of file controller.c.
References srd_decoder_inst::data_num_probes, srd_decoder_inst::data_samplerate, srd_decoder_inst::data_unitsize, SRD_ERR_PYTHON, and SRD_OK.