Hello Helge,
Is that the exact code you're running:
If so, wouldn't it need to be
def __init__(self):
pass
def decode(self, ss, es, data):
instead? Maybe that's what's confusing the python parser.
Regards
-Soeren
On Mon, 2020-04-13 at 11:13 +0200, Helge Kruse wrote:
> I think this should be a FAQ style question but unfortunately I
> didn't
> find any answer yet. I have decoder added to the directory
> ~/.local/share/libsigrokdecode/decoders like this
>
> class Decoder(srd.Decoder):
> api_version = 3
> id = 'seanet'
> inputs = ['uart']
> outputs = ['seanet']
>
> def __init__(self):
>
> def decode(self, ss, es, data):
>
> The defined function contain the code as in previous decoders and the
> attribute list is longer.
>
> When I run sigrok with this decoder I get the message
>
> srd: TypeError: Protocol decoder instance seanet-1: : decode()
> missing 3
> required positional arguments: 'ss', 'es', and 'data'
>
> If I remove the paramters ss,es, and data from the decode parameters
> list, the TypeError is gone. But in that case I don't get any data to
> decode.
>
> Other decoders with input=['uart'] also have a decode function with
> exact that signature. How should I read the TypeError message and how
> can I fix it?
>
> Best regards,
> Helge
>
>
> _______________________________________________
> sigrok-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sigrok-devel
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel