The lower-level protocol decoder must register itself as generating
OUTPUT_PYTHON. Then it uses that id when calling put() in order to pass
data up to a stacked decoder.
https://sigrok.org/wiki/Protocol_decoder_output#Python_output

The modbus decoder does not currently register OUTPUT_PYTHON so you will
need to add that and put() the data you want to generate before you can
stack another decoder on top. OUTPUT_PYTHON is separate from the usual
annotation messages and can be arbitrary Python objects.

I had a similar need to stack a higher-level decoder on lin, which did not
yet implement OUTPUT_PYTHON. The required changes look like this:
https://github.com/sigrokproject/libsigrokdecode/pull/58

Of course there are several existing protocol decoder stacks in the main
repo that already work using OUTPUT_PYTHON, they are good examples to
follow as well.

On Wed, Aug 28, 2024 at 2:08 PM via sigrok-devel <
sigrok-devel@lists.sourceforge.net> wrote:

> ­I have a device that talks modbus. I would like to create a sigrok
> decoder that stacks on top of modbus, so I can decode the messages further,
> but I dont know howto use "modbus" as input for my decoder.
> In this list [1], I see the modbus decoder has the output ID "modbus", but
> there are no decoders that use modbus as input, so I can't see how other
> decoder do that.
> [1] "https://sigrok.org/wiki/Protocol_decoders";
>
> Where can I find this out?
>
>
> ------------------------------
>
> Your E-Mail. Your Cloud. Your Office. *eclipso Mail Europe
> <https://www.eclipso.eu>*.
> _______________________________________________
> sigrok-devel mailing list
> sigrok-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sigrok-devel
>
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to