}
-int pd_output_new(struct srd_decoder_instance *di, int output_type,
+int pd_add(struct srd_decoder_instance *di, int output_type,
char *protocol_id)
{
struct srd_pd_output *pdo;
self.oldsda = None
def start(self, metadata):
- self.output_protocol = self.output_new(sigrokdecode.SRD_OUTPUT_PROTOCOL, 'i2c')
- self.output_annotation = self.output_new(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'i2c')
+ self.output_protocol = self.add(sigrokdecode.SRD_OUTPUT_PROTOCOL, 'i2c')
+ self.output_annotation = self.add(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'i2c')
def report(self):
pass
}
-static PyObject *Decoder_output_new(PyObject *self, PyObject *args)
+static PyObject *Decoder_add(PyObject *self, PyObject *args)
{
PyObject *ret;
struct srd_decoder_instance *di;
if (!PyArg_ParseTuple(args, "is", &output_type, &protocol_id))
return NULL;
- pdo_id = pd_output_new(di, output_type, protocol_id);
+ pdo_id = pd_add(di, output_type, protocol_id);
if (pdo_id < 0)
Py_RETURN_NONE;
else
static PyMethodDef Decoder_methods[] = {
{"put", Decoder_put, METH_VARARGS,
"Accepts a dictionary with the following keys: time, duration, data"},
- {"output_new", Decoder_output_new, METH_VARARGS,
- "Create a new output stream"},
+ {"add", Decoder_add, METH_VARARGS, "Create a new output stream"},
{NULL, NULL, 0, NULL}
};
struct srd_decoder_instance *dec, uint8_t *inbuf, uint64_t inbuflen);
int srd_session_feed(uint64_t timeoffset, uint64_t duration, uint8_t *inbuf,
uint64_t inbuflen);
-int pd_output_new(struct srd_decoder_instance *di, int output_type,
+int pd_add(struct srd_decoder_instance *di, int output_type,
char *output_id);
struct srd_decoder_instance *get_di_by_decobject(void *decobject);
int srd_register_callback(int output_type, void *cb);