self.oldsda = None
def start(self, metadata):
- self.output_protocol = self.output_new(1)
- self.output_annotation = self.output_new(0)
+ self.output_protocol = self.output_new(1, 'i2c')
+ self.output_annotation = self.output_new(0, 'i2c')
def report(self):
pass
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;
}
-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;
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;