In the PDs (Python code), the 'annotation' variable/attribute is a list
of annotation formats. Use the plural 'annotations' as we do for other
lists such as 'inputs', 'outputs', 'probes', 'options', and so on.
d->outputformats = NULL;
/* Convert class annotation attribute to GSList of **char */
d->outputformats = NULL;
/* Convert class annotation attribute to GSList of **char */
- d->annotation = NULL;
- if (PyObject_HasAttrString(py_res, "annotation")) {
- py_annlist = PyObject_GetAttrString(py_res, "annotation");
+ d->annotations = NULL;
+ if (PyObject_HasAttrString(py_res, "annotations")) {
+ py_annlist = PyObject_GetAttrString(py_res, "annotations");
if (!PyList_Check(py_annlist)) {
if (!PyList_Check(py_annlist)) {
- srd_err("Protocol decoder module %s annotation should be a list", name);
+ srd_err("Protocol decoder module %s annotations should be a list", name);
return SRD_ERR_PYTHON;
}
alen = PyList_Size(py_annlist);
return SRD_ERR_PYTHON;
}
alen = PyList_Size(py_annlist);
if (py_strlist_to_char(py_ann, &ann) != SRD_OK)
return SRD_ERR_PYTHON;
if (py_strlist_to_char(py_ann, &ann) != SRD_OK)
return SRD_ERR_PYTHON;
- d->annotation = g_slist_append(d->annotation, ann);
+ d->annotations = g_slist_append(d->annotations, ann);
license = 'gplv3+'
inputs = ['i2c']
outputs = ['ddc']
license = 'gplv3+'
inputs = ['i2c']
outputs = ['ddc']
["Byte stream", "DDC byte stream as read from display."],
]
["Byte stream", "DDC byte stream as read from display."],
]
options = {
'address-space': ['Address space (in bits)', 7],
}
options = {
'address-space': ['Address space (in bits)', 7],
}
# ANN_SHIFTED
["7-bit shifted hex",
"Read/Write bit shifted out from the 8-bit i2c slave address"],
# ANN_SHIFTED
["7-bit shifted hex",
"Read/Write bit shifted out from the 8-bit i2c slave address"],
# ANN_ASCII
["ASCII", "TODO: description"],
]
# ANN_ASCII
["ASCII", "TODO: description"],
]
# TODO: Options to invert the signal(s).
# ...
}
# TODO: Options to invert the signal(s).
# ...
}
# ANN_ASCII
["ASCII", "TODO: description"],
# ANN_DEC
# ANN_ASCII
["ASCII", "TODO: description"],
# ANN_DEC
}
ann_id = PyLong_AsLong(py_tmp);
}
ann_id = PyLong_AsLong(py_tmp);
- if (!(pdo = g_slist_nth_data(di->decoder->annotation, ann_id))) {
+ if (!(pdo = g_slist_nth_data(di->decoder->annotations, ann_id))) {
srd_err("Protocol decoder %s submitted data to non-existent annotation format %d",
di->decoder->name, ann_id);
return SRD_ERR_PYTHON;
srd_err("Protocol decoder %s submitted data to non-existent annotation format %d",
di->decoder->name, ann_id);
return SRD_ERR_PYTHON;
/* List of NULL-terminated char[], containing descriptions of the
* supported annotation output.
*/
/* List of NULL-terminated char[], containing descriptions of the
* supported annotation output.
*/
/** TODO */
PyObject *py_mod;
/** TODO */
PyObject *py_mod;