diff options
author | Bert Vermeulen <bert@biot.com> | 2012-01-07 03:59:16 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2012-01-07 03:59:16 +0100 |
commit | 0ee4dd54ce134158cd2068866ddc7d32c692d457 (patch) | |
tree | 55d1f6f9bc8a27e0341b55bd74b18a26b7edc7da /module_sigrokdecode.c | |
parent | f9afa08467a7a11317f0e40145091a5945a54eda (diff) | |
download | libsigrokdecode-0ee4dd54ce134158cd2068866ddc7d32c692d457.tar.gz libsigrokdecode-0ee4dd54ce134158cd2068866ddc7d32c692d457.zip |
Decoder.output_new() now takes an extra protocol_id argument.
Diffstat (limited to 'module_sigrokdecode.c')
-rw-r--r-- | module_sigrokdecode.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/module_sigrokdecode.c b/module_sigrokdecode.c index d4af5c3..b3bdafd 100644 --- a/module_sigrokdecode.c +++ b/module_sigrokdecode.c @@ -128,7 +128,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) case SRD_OUTPUT_PROTOCOL: /* TODO: SRD_OUTPUT_PROTOCOL should go up the PD stack. */ - printf("%s protocol data: ", pdo->decoder->name); + printf("%s protocol data: ", pdo->protocol_id); PyObject_Print(data, stdout, Py_PRINT_RAW); puts(""); break; @@ -143,7 +143,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) } -static PyObject *Decoder_output_new(PyObject *self, PyObject *py_output_type) +static PyObject *Decoder_output_new(PyObject *self, PyObject *args) { PyObject *ret; struct srd_decoder_instance *di; @@ -155,11 +155,9 @@ static PyObject *Decoder_output_new(PyObject *self, PyObject *py_output_type) printf("output_new di %s\n", di->decoder->name); - if (!PyArg_ParseTuple(py_output_type, "i:output_type", &output_type)) + if (!PyArg_ParseTuple(args, "is", &output_type, &protocol_id)) return NULL; - /* TODO: take protocol_id from python */ - protocol_id = "i2c"; pdo_id = pd_output_new(di, output_type, protocol_id); if (pdo_id < 0) Py_RETURN_NONE; |