if (!PyObject_HasAttrString(di->decoder->py_dec, "options")) {
/* Decoder has no options. */
if (!PyObject_HasAttrString(di->decoder->py_dec, "options")) {
/* Decoder has no options. */
/* Create a new instance of this decoder class. */
if (!(di->py_inst = PyObject_CallObject(dec->py_dec, NULL))) {
if (PyErr_Occurred())
srd_exception_catch("Failed to create %s instance",
decoder_id);
/* Create a new instance of this decoder class. */
if (!(di->py_inst = PyObject_CallObject(dec->py_dec, NULL))) {
if (PyErr_Occurred())
srd_exception_catch("Failed to create %s instance",
decoder_id);
if (options && srd_inst_option_set(di, options) != SRD_OK) {
g_free(di->dec_channelmap);
g_free(di);
if (options && srd_inst_option_set(di, options) != SRD_OK) {
g_free(di->dec_channelmap);
g_free(di);
struct srd_decoder_inst *di_bottom,
struct srd_decoder_inst *di_top)
{
struct srd_decoder_inst *di_bottom,
struct srd_decoder_inst *di_top)
{
/* Run self.start(). */
if (!(py_res = PyObject_CallMethod(di->py_inst, "start", NULL))) {
srd_exception_catch("Protocol decoder instance %s",
di->inst_id);
/* Run self.start(). */
if (!(py_res = PyObject_CallMethod(di->py_inst, "start", NULL))) {
srd_exception_catch("Protocol decoder instance %s",
di->inst_id);
/* Set self.matched to None. */
PyObject_SetAttrString(di->py_inst, "matched", Py_None);
/* Set self.matched to None. */
PyObject_SetAttrString(di->py_inst, "matched", Py_None);
/*
* Call self.decode(). Only returns if the PD throws an exception.
* "Regular" termination of the decode() method is not expected.
/*
* Call self.decode(). Only returns if the PD throws an exception.
* "Regular" termination of the decode() method is not expected.
srd_dbg("%s: decode() terminated unrequested.", di->inst_id);
srd_exception_catch("Protocol decoder instance %s: ", di->inst_id);
srd_dbg("%s: Thread done (!res, !want_term).", di->inst_id);
srd_dbg("%s: decode() terminated unrequested.", di->inst_id);
srd_exception_catch("Protocol decoder instance %s: ", di->inst_id);
srd_dbg("%s: Thread done (!res, !want_term).", di->inst_id);
srd_dbg("Freeing instance %s", di->inst_id);
srd_inst_join_decode_thread(di);
srd_dbg("Freeing instance %s", di->inst_id);
srd_inst_join_decode_thread(di);